[SERVER-29831] Can create invalid dbref using insert Created: 23/Jun/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-29819 Can create invalid dbref using $unset... Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

$id should be a required field of a dbref, but it is not enforced in insert:

> db.coll.insert({a: {$ref: "c", $db: "test"}})
WriteResult({ "nInserted" : 1 })
> db.coll.find()
{ "_id" : ObjectId("594d2455ae497a9bea475a72"), "a" : { "$ref" : "c", "$db" : "test" } }


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