-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.0
-
Component/s: JavaScript
-
None
-
Minor Change
-
ALL
It's hard to find any documentation on DBRefs.
But I believe the intention is that the $id field can be anything that can be stored as _id.
The JSON parser however insists that it is a quoted 24 char hex string, or "ObjectId(...)".
See:
https://github.com/mongodb/mongo/blob/master/src/mongo/db/json.cpp#L663
https://github.com/mongodb/mongo/blob/master/src/mongo/db/json.cpp#L467
These should be valid objects:
fromjson("{myref:DBRef('coll',1)}") fromjson("{myref:{$ref:'coll',$id:1}}")
But they both fail.
- is duplicated by
-
SERVER-9045 mongoimport doesn't accept dbref
- Closed