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

dropDatabase command provides no indication of whether database existed

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.4
    • Affects Version/s: 3.1.3
    • Component/s: Internal Code
    • Fully Compatible
    • ALL

      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 }
      

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

              Created:
              Updated:
              Resolved: