There are many update operators that can be used during document updates.
The following operators can be used to update fields:
$currentDate
: Sets the field value to the current date$inc
: Increments the field value$rename
: Renames the field$set
: Sets the value of a field$unset
: Removes the field from the documentThe following operators assist with updating arrays.
$addToSet
: Adds distinct elements to an array$pop
: Removes the first or last element of an array$pull
: Removes all elements from an array that match the query$push
: Adds an element to an array截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!