collection.update

Anywhere

collection.update(selector, modifier, [options], [callback])

Modify one or more documents in the collection. Returns the number of affected documents.

Arguments

selector Mongo Selector, Object ID, or String

Specifies which documents to modify

modifier Mongo Modifier

Specifies how to modify the documents

callback Function

Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.

Options

multi Boolean

True to modify all matching documents; false to only modify one of the matching documents (the default).

upsert Boolean

True to insert a document if no matching documents are found.

doc_Meteor
2016-05-29 17:18:11
Comments
Leave a Comment

Please login to continue.