docs
CURD
Update

Update

The update() method is used to modify an existing document or documents in a collection.

let collection = db.collection::<Document>("config");
collection.update_many(doc! {
    "_id": "c2"
}, doc! {
    "$set": doc! {
        "value": "c33",
    },
})?;

Operations

NameDescription
$incIncrements the value of the field by the specified amount.
$minOnly updates the field if the specified value is less than the existing field value.
$maxOnly updates the field if the specified value is greater than the existing field value.
$mulMultiplies the value of the field by the specified amount.
$renameRenames a field.
$setSets the value of a field in a document.
$unsetRemoves the specified field from a document.