[DOCS-1289] mongo shell DBRef is not documented Created: 22/Mar/13  Updated: 30/Oct/23  Resolved: 27/Jul/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-9082 JSON parser doesn't accept simple DBR... Closed
Participants:
Days since reply: 7 years, 29 weeks ago

 Description   

http://docs.mongodb.org/manual/applications/database-references/#dbrefs

It only mentions that the mongo shell offers a DBRef but there is nothing about usage nor an example.

For example, it is unclear whether or not the second parameter in DBRef needs to be surrounded by quotes, or needs to be a proper ObjectId.

It seems rather flexible when using it in the shell, i.e DBRef("coll", 1) seems to work, however, the JSON parser code insists that the second field is a quoted string containing 24 characters, see:

https://github.com/mongodb/mongo/blob/master/src/mongo/db/json.cpp#L663



 Comments   
Comment by Emily Hall [ 27/Jul/16 ]

Closed by Emily Hall for Housekeeping on 7/27/16.
Please create a new ticket if for prioritization.

Thank you!

Comment by Scott Hernandez (Inactive) [ 22/Mar/13 ]

That is a bug in the parser.
On Mar 22, 2013 9:55 AM, "Thomas Rueckstiess (JIRA)" <jira@mongodb.org>

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