Delete
The delete()
method is used to removes all documents that match the filter from a collection.
let deleted_result = collection.delete_many(doc!{
"_id": key,
})?;
Condition
Name | Description |
---|---|
$eq | Matches values that are equal to a specified value. |
$gt | Matches values that are greater than a specified value. |
$gte | Matches values that are greater than or equal to a specified value. |
$in | Matches any of the values specified in an array. |
$lt | Matches values that are less than a specified value. |
$lte | Matches values that are less than or equal to a specified value. |
$ne | Matches all values that are not equal to a specified value. |
$nin | Matches none of the values specified in an array. |
$regex | Matches values that are equal to the given regular expression. |
Those conditions are the same listed in the Advanced conditions (opens in a new tab).