[−][src]Trait avocado::ops::Query
A regular query (find_one()
or find_many()
) operation.
Associated Types
type Output: for<'a> Deserialize<'a>
The type of the results obtained by executing the query. Often it's just
the document type, T
. TODO(H2CO3): make it default to T
(#29661).
Provided methods
fn filter(&self) -> Document
Filter for restricting returned values. Defaults to an empty filter, resulting in all documents of the collection being returned.
fn transform(raw: Document) -> Result<Bson>
Optional transform applied to each returned raw document. Can be used
to adjust the structure of the loosely-typed data so that it fits
what is expected by <Self::Output as Deserialize>::deserialize()
.
The default implementation just returns its argument verbatim.
fn options() -> FindOptions
Options for this query.