Parameters
- filter «Object»
[options.strict] «Boolean|String» overwrites the schema’s
[options.upsert=false] «Boolean» if true, and no documents found, insert a new document
[options.timestamps=null] «Boolean» If set to and schema-level timestamps are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set.
Returns:
- «Query»
Same as update()
, except it does not support the multi
or overwrite
options.
- MongoDB will update only the first document that matches regardless of the value of the
multi
option.
Example:
This function triggers the following middleware.