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

Invalid queries accepted by delete command for collection that doesn't exist

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Write Ops
    • Query
    • ALL

      > db.exists.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.exists.runCommand('delete', {deletes: [{q:{$invalid: true}, limit:0}]})
      {
              "ok" : 1,
              "n" : 0,
              "writeErrors" : [
                      {
                              "index" : 0,
                              "code" : 17218,
                              "errmsg" : "Can't canonicalize query { $invalid: true }"
                      }
              ]
      }
      > db.doesnt_exist.runCommand('delete', {deletes: [{q:{$invalid: true}, limit:0}]})
      { "ok" : 1, "n" : 0 }
      

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: