【MongoDB】Update Operators
作者:互联网
Update Operators
Fields
Name | Description |
---|---|
Sets the value of a field to current date, either as a Date or a Timestamp. | |
Increments the value of the field by the specified amount. | |
Only updates the field if the specified value is less than the existing field value. | |
Only updates the field if the specified value is greater than the existing field value. | |
Multiplies the value of the field by the specified amount. | |
Renames a field. | |
Sets the value of a field in a document. | |
Sets the value of a field if an update results in an insert of a document. Has no effect on update operations that modify existing documents. | |
Removes the specified field from a document. |
Array
Operators
Name | Description |
---|---|
Acts as a placeholder to update the first element that matches the query condition. | |
Acts as a placeholder to update all elements in an array for the documents that match the query condition. | |
Acts as a placeholder to update all elements that match the | |
Adds elements to an array only if they do not already exist in the set. | |
Removes the first or last item of an array. | |
Removes all array elements that match a specified query. | |
Adds an item to an array. | |
Removes all matching values from an array. |
Modifiers
Name | Description |
---|---|
Modifies the | |
Modifies the | |
Modifies the | |
Modifies the |
Bitwise
Name | Description |
---|---|
Performs bitwise |
参考:https://docs.mongodb.com/manual/reference/operator/update/
标签:elements,MongoDB,Operators,Update,value,update,field,specified,array 来源: https://blog.csdn.net/for_cxc/article/details/117884884