June 2014
Intermediate to advanced
696 pages
38h 52m
English
The save() method on Collection objects is kind of interesting. You can use it to insert or update a document in a database. Although it is not as efficient as insert() or update(), the save() method is easier to implement in some circumstances. For example, when you are making ad hoc changes to objects already retrieved from a MongoDB database, you can use save() without having to implement the query and update objects of the update() method.
The following is the syntax of the save() method:
save(doc, [options], [callback])
The doc parameter is the document object you want to save to the collection. The options parameter specifies the database change options described in Table 14.1 ...
Read now
Unlock full access