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

Can create invalid dbref using insert

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Write Ops
    • Query Optimization
    • ALL

    Description

      $id should be a required field of a dbref, but it is not enforced in insert:

      > db.coll.insert({a: {$ref: "c", $db: "test"}})
      WriteResult({ "nInserted" : 1 })
      > db.coll.find()
      { "_id" : ObjectId("594d2455ae497a9bea475a72"), "a" : { "$ref" : "c", "$db" : "test" } }
      

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: