[−][src]Trait avocado::ops::FindAndUpdate
An operation for querying and updating the same document atomically, in a single step.
Associated Types
type Output: for<'a> Deserialize<'a>
The type of the results returned by the operation. Often it's just
the document type, T
. TODO(H2CO3): make it default to T
(#29661).
Required methods
fn filter(&self) -> Document
Filter for restricting documents to update or upsert.
fn update(&self) -> Document
The update or upsert to perform.
Provided methods
fn transform(raw: Document) -> Result<Bson>
Optional transform applied to the 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() -> FindOneAndUpdateOptions
Options for this query-and-update operation.
Implementations on Foreign Types
impl<T: Doc, U: FindAndUpdate<T>, '_> FindAndUpdate<T> for &'_ U
[src]
impl<T: Doc, U: FindAndUpdate<T>, '_> FindAndUpdate<T> for &'_ U
type Output = U::Output
fn filter(&self) -> Document | [src] |
fn update(&self) -> Document | [src] |
fn transform(raw: Document) -> Result<Bson> | [src] |
fn options() -> FindOneAndUpdateOptions | [src] |