http://mongoosejs.com/docs/api.html#model_Model.update
Model.update = function update (conditions, doc, options, callback) {
var mq = new Query({}, {}, this, this.collection);
return mq.update(conditions, doc, options, callback);
};
Valid options:
-
safe
(boolean) safe mode (defaults to value set in schema (true)) -
upsert
(boolean) whether to create the doc if it doesn't match (false) -
multi
(boolean) whether multiple documents should be updated (false) -
strict
(boolean) overrides thestrict
option for this update -
overwrite
(boolean) disables update-only mode, allowing you to overwrite the doc (false)
C:\Users\admin\Documents\NetBeansProjects\mchat\public_html\node_modules\mongoose\model.js
可直接参考源码中的注释