-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.6.2
-
Component/s: Write Ops
-
None
-
Environment:mongodb 1.6.2, pymongo-1.8.1, python 2.6
-
Query
-
OS X
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When multiple keys are put together with an $or expression and the upsert flag is sent to update (and the multi flag is set) objects are not created for the items in the $or expression.
This code using pymongo:
keys = []
for item in items:
key =
keys.append(key)
if len(keys) == 0:
return
query =
{ '$or' : keys } value = {
'$inc' :
}
db.abc_counts.update(query, value, upsert=True, multi=True)
Produces this in the DB:
{ "_id" : ObjectId("4c8e7161010f681721439e58"), "count" : 1 }if i replace query with keys[0] it works as expected.