批量更新MongoDB的列。

db.User.find().forEach(
   function(item){                 
       db.User.update({"_id":item._id},{"$set":{"LastUpdate":item.CreateAt}},false,true) 
    }
)

  

原文地址:https://www.cnblogs.com/haoliansheng/p/6273627.html