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

dropDatabase command provides no indication of whether database existed

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.4
    • 3.1.3
    • Internal Code
    • Fully Compatible
    • ALL

    Description

      The behavior in 3.0 was to only include the "dropped" field in the response only if the database actually existed. This was changed as part of 1725d76. However, the behavior prior to 3.0 was to always include the "dropped" field, regardless of whether the database existed before the command was executed.

      > db.version()
      3.1.2
      > db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      

      > db.version()
      3.1.1
      > db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > db.dropDatabase()
      { "ok" : 1 }
      

      > db.version()
      3.0.3
      > db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > db.dropDatabase()
      { "ok" : 1 }
      

      > db.version()
      2.6.10
      > db.foo.insert({})
      WriteResult({ "nInserted" : 1 })
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      

      > db.version()
      2.4.14
      > db.foo.insert({})
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      > db.dropDatabase()
      { "dropped" : "test", "ok" : 1 }
      

      Attachments

        Activity

          People

            matt.dannenberg Matt Dannenberg
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: