MongoDB $or query

Use $in For the query in the question, it’s more appropriate to use $in db.Profiles.find ( { “name” : { $in: [“gary”, “rob”] } } ); Why doesn’t it work There’s a missing quote – the cli is waiting for you to finish the second part of your or: db.Profiles.find ( { $or : [ … Read more

multiple mongo update operator in a single statement?

Multiple updates may be performed on the same document, as long as those updates do not conflict (hence the “have conflicting mods in update” error). Because “$push” : {“bugs” : [{“name”:”bug1″, “count”:1}]} and “$inc” : {“bugs.0.count” : 1} are both attempting to modify the same portion of the document (namely the “bugs” array), they conflict. … Read more