Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 mongoose 更新 MongoDB 中的一行,我传递了唯一的帐号,但我无法更新该行。
this.update({account_no:key},{valid:'true'},{ upsert: true }, function(){});
这有什么问题?
谢谢,
请试试
this.update({account_no:key}, { $set: { valid: 'true' }},{ upsert: true }, function(){});
并利用$set in update 参数。可能是它!