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

Behavior difference between count command with namespace or UUID

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Storage 2017-10-23
    • 68

      count run on a non-existent namespace returns OK, but given a non-existent UUID it returns NamespaceNotFound

      > db.getCollectionInfos()
      [
              {
                      "name" : "foo",
                      "type" : "collection",
                      "options" : {
      
                      },
                      "info" : {
                              "readOnly" : false,
                              "uuid" : BinData(4,"tPsr7mDORhazM+lgLNtyIQ==")
                      },
                      "idIndex" : {
                              "v" : 2,
                              "key" : {
                                      "_id" : 1
                              },
                              "name" : "_id_",
                              "ns" : "test.foo"
                      }
              }
      ]
      
      > db.runCommand({count: BinData(4,"tPsr7mDORhazM+lgLNtyIQ==")})
      { "n" : 1, "ok" : 1 }
      
      > db.runCommand({count: BinData(4,"tPyu7mDORhazM+lgLNtyIe==")})
      {
              "ok" : 0,
              "errmsg" : "UUID b4fcaeee-60ce-4616-b333-e9602cdb7221 specified in count command not found in test database",
              "code" : 26,
              "codeName" : "NamespaceNotFound"
      }
      
      > db.runCommand({count: "jklklsdjk"})
      { "n" : 0, "ok" : 1 }
      

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: