mongodb 更新操作

db.aaaa.update({},{$push:{money:{$each:[8,9,10],$slice:-4}}})    

 

 

  db.aaaa.update({},{$addToSet:{money:{$each:[8,9,10,11,12,13]}}})

 

 

        db.aaaa.update({},{$pop:{"money":-11}})

       db.aaaa.update({},{$pull:{"money":10.0}})

 

 

                         db.coll.updateMany({"rep":31},{$inc:{"rep":3}},{upsert:true})

 

 

 

posted @ 2018-07-31 16:27  anxbb  阅读(131)  评论(0编辑  收藏  举报