-
Notifications
You must be signed in to change notification settings - Fork 84
Data Modifying Operators
o5faruk edited this page May 2, 2021
·
5 revisions
This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/data-modifying-operators/
The following modifiers are available for use in update operations; e.g. in buildfire.datastore.update() and buildfire.datastore.save()
-
$incIncrements the value of the field by the specified amount. read more -
$mulMultiplies the value of the field by the specified amount. -
$renameRenames a field. -
$setOnInsertSets 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. -
$setSets the value of a field in a document. -
$unsetRemoves the specified field from a document. -
$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.
-
$addToSetAdds elements to an array only if they do not already exist in the set. -
$popRemoves the first or last item of an array. -
$pullAllRemoves all matching values from an array. -
$pullRemoves all array elements that match a specified query. -
$pushAllDeprecated. Adds several items to an array. -
$pushAdds an item to an array.
#Modifiers
-
$eachModifies the $push and $addToSet operators to append multiple items for array updates. -
$sliceModifies the $push operator to limit the size of updated arrays. -
$sortModifies the $push operator to reorder documents stored in an array. -
$positionModifies the $push operator to specify the position in the array to add elements.