Description
The string representation of DBRef only shows the $ref and $id but not the $db. This could lead to confusion if the DBRef references a different database.
> db.halloa.find({"name" : "dukur"}) |
{ "_id" : ObjectId("519e5c065ef254863b9051c6"), "name" : "dukur", "myref" : DBRef("people", "5191cc6684ae75ea07e4ef3b") } |
> z=db.halloa.find({"name" : "dukur"}).toArray()[0] |
{
|
"_id" : ObjectId("519e5c065ef254863b9051c6"), |
"name" : "dukur", |
"myref" : DBRef("people", "5191cc6684ae75ea07e4ef3b") |
}
|
> z.myref.$id
|
5191cc6684ae75ea07e4ef3b
|
> z.myref.$ref
|
people
|
> z.myref.$db
|
kamal
|
Attachments
Issue Links
- is duplicated by
-
SERVER-9677 $db values for DBRef datatype does not seem to persist in mongo collection
-
- Closed
-
- is related to
-
CDRIVER-457 Allow DBRef object notation for embedded documents
-
- Closed
-
-
SERVER-10777 Allow JSON Parser to support additional fields when parsing DBRefs
-
- Closed
-
- related to
-
SERVER-23786 Server allows insertion and update of invalid DBRef documents
-
- Backlog
-
-
SERVER-14554 DBRef JS constructor does not accept $db with --js-engine=v8-3.25
-
- Closed
-
- links to