db.example.update(
{ _id: ObjectId("5024d352ef2ff4c4a103db5f") },
{ $pull: { items: { $regex: /item/ } } }
)
Do the same but on all documents in collection:
db.example.update({}, { $pull: { items: { $regex: /item/ } } }, false, true)
Oh I so wish it'd be in the official docs - I spent 2 days trying to figure it out!
No comments:
Post a Comment