June 2014
Intermediate to advanced
696 pages
38h 52m
English
When performing updates on objects in MongoDB, you need to specify exactly what fields need to be changed and how they need to be changed. Unlike in SQL, where you create long query strings to define an update, in MongoDB you can implement an update object with operators that define exactly how to change the data in the documents.
You can include as many operators in the update object as you need. The format of the update object is shown below:
{ <operator>: {<field_operation>, <field_operation>, . . .}, <operator>: {<field_operation>, <field_operation>, . . .} . . .}
For example, consider the following object:
{ name: "myName", countA: 0, ...
Read now
Unlock full access