Details
-
Bug
-
Status: Closed
-
Critical - P2
-
Resolution: Done
-
None
-
None
-
None
-
4
-
Docs Sprint 16 - Ending 3/13
Description
in db.collection.update() we should call out that there is additional validation between the query and update objects, and that the paths must match if _id is specified in the update, and that dotted paths aren't acceptable in the query (e.g. _id.field)
Changed in SERVER-14973
Scott and Greg discussed this during the code review
Example:
> q={'_id.git_hash': 'e6577bc37'}
|
> u={'count': 49.97, '_id': {'hash': 'e6577bc37'}}
|
|
> 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.build_id'found"
|
}
|
})
|
Attachments
Issue Links
- related to
-
DOCS-5167 Should not include dot notation example in db.collection.update() reference
-
- Closed
-
-
SERVER-17399 db.collection.update() upsert behavior change from 2.6 when query includes predicate on _id
-
- Closed
-