mongoosejs update

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);
};

Parameters:

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 the strict 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

可直接参考源码中的注释

猜你喜欢

转载自jadeluo.iteye.com/blog/2097894