Find performs a conditional query on the specified collection.
| 11 | |
| 12 | // Find performs a conditional query on the specified collection. |
| 13 | type Find struct { |
| 14 | Database string // database name |
| 15 | Collection string // collection name |
| 16 | Query map[string]interface{} // query filter |
| 17 | Sort []string // sort fields, e.g. Sort("firstname", "-lastname") for asc firstname, desc lastname |
| 18 | Skip int // skip first n documents |
| 19 | Limit int // return at most n documents |
| 20 | Select interface{} // projection, e.g. {"name":1} to return only name |
| 21 | } |
| 22 | |
| 23 | func (f *Find) Exec(resultPtr interface{}) (r result.Result[any]) { |
| 24 | defer r.Catch() |
nothing calls this directly
no outgoing calls
no test coverage detected