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 thestrictoption 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
可直接参考源码中的注释
Mongoose JS Model update API详解
本文深入解析了Mongoose JS中Model.update方法的使用,包括参数解释、有效选项及源码注释。
175

被折叠的 条评论
为什么被折叠?



