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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.6.0-rc0
    • Write Ops
    • Query
    • ALL

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: