Details
-
Task
-
Status: Closed
-
Minor - P4
-
Resolution: Fixed
-
None
-
None
-
None
-
3
-
ServerDocs2022: Apr5 - Apr12
Description
Concise definition of a DBRef from SERVER-12263:
DBRefs are objects whose first two fields must be $ref and $id (in that order). An optional $db field, if present, must appear third. Other fields may follow (they can't have a $ prefix, of course).
We don't seem to have a real spec for DBRef objects, but the note about optional fields beyond $db is important. Some libraries and ODMs store extra metadata in these fields, and it'd be helpful to document that MongoDB does allow this (both for community developers and our own reference, as the server has broken this validation from time to time).
Scope of Changes
Review and update https://docs.mongodb.com/manual/reference/database-references/ with info on optional fields beyond $db. We should clarify that MongoDB does allow this functionality with DBRefs.
Attachments
Issue Links
- is related to
-
SERVER-12263 Support $elemMatch with DBRefs that may contain additional properties
-
- Closed
-
-
DRIVERS-1173 Driver Handling of DBRefs
-
- Implementing
-