-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
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" } })
- 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