Mongodb 使用arrayfilter

db.runCommand({ "update" : "ShortBatchOrder", "updates" : [{ "q" : { "_id" : "xxxxxxxx") }, "u" : { "$set":{"data.$[data].isDelete" : "1"} }, "upsert" : true, "arrayFilters" : [{ "data.orderCode" : { "$in" : ["xxxxxxx"] } }] }] })

 

 

db.getCollection('batchorder').update({"_id":"xxxxxxxxxxxx","data.ordernum":"111"},{"$set":{"data.$[data].hberror":"testssss"}},{ "arrayFilters": [{ "data.ordernum": "111" }], "multi": true })

posted @ 2020-03-24 09:29  地球上的我  阅读(3829)  评论(0编辑  收藏  举报