[SERVER-612] Allow Arbitrary Properties on DBRefs Created: 08/Feb/10  Updated: 12/Jul/16  Resolved: 17/Feb/10

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 1.3.3

Type: Improvement Priority: Major - P3
Reporter: Vinny Fiano Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-10777 Allow JSON Parser to support addition... Closed
is related to CDRIVER-457 Allow DBRef object notation for embed... Closed
Participants:

 Description   

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(

{\"otherobj.extra\":1}

).extra)"

The last line should return "1", it currently returns "null".



 Comments   
Comment by auto [ 17/Feb/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-612 fix v8 issue
http://github.com/mongodb/mongo/commit/1d97a69eaea63cbff5889a115f66634a6aa2d317

Comment by auto [ 17/Feb/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-612 informal dbref v8
http://github.com/mongodb/mongo/commit/081795ed7592466bf5788470ab3d23316c6714fa

Comment by auto [ 17/Feb/10 ]

Author:

{'login': 'astaple', 'name': 'Aaron', 'email': 'aaron@10gen.com'}

Message: SERVER-612 informal dbref for sm
http://github.com/mongodb/mongo/commit/0ffefe9bc0d01585671e4ddbd4101663aa386fe7

Generated at Thu Feb 08 02:54:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.