Symptom:
db.timeline_cache.update({_id: { $in: ["100"]} }, { $push: { _c: { $each: [ { _id: ObjectId('53a20638e4b0df77093c1abb'), _a: "asya", _m: "OMG, this SUCKS!!!" } ], $slice: -15 } } }) update { q: { _id: { $in: [ "100" ] } }, u: { $push: { _c: { $each: [ { _id: ObjectId('53a20638e4b0df77093c1abb'), _a: "asya", _m: "OMG!!!" } ], $slice: -15.0 } } }, multi: false, upsert: false } does not contain _id or shard key for pattern { _id: "hashed" } WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0, "writeError" : { "code" : 61, "errmsg" : "update { q: { _id: { $in: [ \"100\" ] } }, u: { $push: { _c: { $each: [ { _id: ObjectId('53a20638e4b0df77093c1abb'), _a: \"asya\", _m: \"OMG, this SUCKS!!!\" } ], $slice: -15.0 } } }, multi: false, upsert: false } does not contain _id or shard key for pattern { _id: \"hashed\" }" } })
The same update with _id:"100" works fine. Arguably $in:100 could be interpreted during upsert as equality.
- duplicates
-
SERVER-12024 re-implement $in in terms of $or
- Backlog
- is duplicated by
-
SERVER-17458 Update with upsert true with _id 'in' x query does not work in hashed sharded collection
- Closed
- related to
-
SERVER-12024 re-implement $in in terms of $or
- Backlog