Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9790

DBRef string representation should include $db

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 2.7.2
    • Shell

    Description

      The string representation of DBRef only shows the $ref and $id but not the $db. This could lead to confusion if the DBRef references a different database.

      > db.halloa.find({"name" : "dukur"})
      { "_id" : ObjectId("519e5c065ef254863b9051c6"), "name" : "dukur", "myref" : DBRef("people", "5191cc6684ae75ea07e4ef3b") }
      > z=db.halloa.find({"name" : "dukur"}).toArray()[0]
      {
          "_id" : ObjectId("519e5c065ef254863b9051c6"),
          "name" : "dukur",
          "myref" : DBRef("people", "5191cc6684ae75ea07e4ef3b")
      }
      > z.myref.$id
      5191cc6684ae75ea07e4ef3b
      > z.myref.$ref
      people
      > z.myref.$db
      kamal

      Attachments

        Issue Links

          Activity

            People

              stephen.lee Stephen Lee
              stephen.lee Stephen Lee
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: