2013-12-16 41 views

回答

2

From the Mongo docs -

默认情况下,update()方法更新 匹配其选择标准在单个文档。使用多选项 将该方法设置为true以更新多个文档。

所以,你应该运行这样的查询:

db.posts.update(
    {author:{$lt:0}}, 
    {$set:{author:582127753}}, 
    { multi: true } 
) 
+0

的伎俩!非常感谢; 不能upvote答案,对不起.. – Sekai