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

Allow Arbitrary Properties on DBRefs

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.3.3
    • JavaScript
    • None

    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".

      Attachments

        Issue Links

          Activity

            People

              aaron Aaron Staple
              ynniv Vinny Fiano
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: