Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"_id":ObjectId("5a934e000102030405000000"),cart:{items:[{productId:1},{productId:2},{productId:3},]}}]
Query
db.collection.update({},{$pull:{"cart.items":{productId:2}}})
Result