Struct mongod::query::Delete [−][src]
pub struct Delete<C: Collection> { /* fields omitted */ }
Expand description
A querier to delete documents from a MongoDB collection.
Examples
Delete all documents from a collection.
#[derive(Bson, Mongo)] #[mongo(collection="users", field, filter, update)] pub struct User { name: String, } let client = mongod::Client::new(); let deleted = mongod::query::Delete::<User>::new() .query(&client) .await .unwrap(); println!("delete {} documents", deleted);
Implementations
The collation to use for the operation.
Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.
The filter to use for the operation.
Errors
This method errors if the filter could not be converted into a BSON Document
.
A document or string that specifies the index to use to support the query predicate.
Enable delete many for this operation.
Removes all documents that match the filter from a collection.
The write concern for the operation.
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for Delete<C> where
C: RefUnwindSafe,
impl<C> UnwindSafe for Delete<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self