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

Can create invalid dbref using insert

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • Query Optimization
    • ALL

      $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" } }
      

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

              Created:
              Updated: