Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1289

mongo shell DBRef is not documented

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual
    • None

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 29 weeks ago