| Steps To Reproduce: |
Given the following query and update objects:
q={ "_id.hash" : "e6577bc7" }
|
u={ "count" : 43.97}
|
If we run update, no upsert, no matches, no updates as expected:
> db.coll_name.update(q,u)
|
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
|
If we make it an upsert it will fail (this is not the case in 2.6)
> db.coll_name.update(q,u,upsert=true)
|
WriteResult({
|
"nMatched" : 0,
|
"nUpserted" : 0,
|
"nModified" : 0,
|
"writeError" : {
|
"code" : 111,
|
"errmsg" : "field at '_id' must be exactly specified, field at sub-path '_id.hash'found"
|
}
|
})
|
If we have a match for the query, it will succeed. Only the upsert behavior has changed.
q={ "_id.hash" : "e6577bc37" }
|
u={ "count" : 49.97}
|
> db.coll_name.update(q,u,upsert=true)
|
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
|
|