[SERVER-29699] upsert:true with a Dotted _id Query should throw error Created: 16/Jun/17  Updated: 16/Nov/21  Resolved: 03/Jul/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: seba kerckhof Assignee: Charlie Swanson
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

According to: https://docs.mongodb.com/manual/reference/method/db.collection.update/#mongodb30-upsert-id

This query:

db.collection.update( { "_id.name": "Robert Frost", "_id.uid": 0 },
   { "categories": ["poet", "playwright"] },
   { upsert: true } )

Should throw an error in mongodb > 3.0, but at least in mongo 3.2.6 I get no errors when executing this query.



 Comments   
Comment by Charlie Swanson [ 03/Jul/17 ]

seba I haven't heard from you, and cannot reproduce this on our end, so I'm going to close this ticket. If you are able to reproduce this, please re-open with the exact steps.

Comment by Charlie Swanson [ 30/Jun/17 ]

seba, I tried this and it worked for me on 3.2.6:

(mongod-3.2.6) test> db.collection.update( { "_id.name": "Robert Frost", "_id.uid": 0 },    { "categories": ["poet", "playwright"] },    { upsert: true } )
field at '_id' must be exactly specified, field at sub-path '_id.name'found
WriteResult({
  "nMatched": 0,
  "nUpserted": 0,
  "nModified": 0,
  "writeError": {
    "code": 111,
    "errmsg": "field at '_id' must be exactly specified, field at sub-path '_id.name'found"
  }
})

Perhaps there is an error being swallowed somewhere?

Generated at Thu Feb 08 04:21:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.