-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: JavaScript
-
None
DBRefs are supposed to be informal, allowing arbitrary properties in addition to $ref, $db, and $id. The database stores them correctly, but the JavaScript shell silently drops them from output. This can be shown by importing data containing an "extra" property, performing a search for records with this set to 1 (demonstrating that the database handles it correctly), and then printing the value of "extra".
To reproduce:
> echo '{ otherobj :
{ "$ref" : "othertable", "$id" : "notimportant", extra : 1 } }' > test.json
> mongoimport -h localhost -d test -c test test.json
> mongo localhost/test --eval "printjson(db.test.findOne(
).extra)"
The last line should return "1", it currently returns "null".
- is related to
-
CDRIVER-457 Allow DBRef object notation for embedded documents
- Closed
- related to
-
SERVER-10777 Allow JSON Parser to support additional fields when parsing DBRefs
- Closed