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

DBClientWithCommands::getCollectionInfos fails against mongodb < 2.7

    • Fully Compatible
    • ALL

      this works against mongodb 2.7:

      > db.runCommand({ listCollections : 1, filter : { name : "dbclient" } })
      {
      	"collections" : [
      		{
      			"name" : "dbclient",
      			"options" : {
      
      			}
      		}
      	],
      	"ok" : 1
      }
      

      But the fallback code in the driver when running against a <2.7 server which does not offer the listCollections command attempts to query system.indexes with the same filter:

      > db.system.namespaces.find({name : "dbclient"}) 
      

      That doesn't match, because in system.namespaces the names are db qualified:

      > db.system.namespaces.find({name : "test.dbclient"})
      { "name" : "test.dbclient" }
      

      So the fallback code will need to make a new BSONObj that db qualifies any 'name' element in the filter.

      Marking this ticket "driver changes needed" since fix will need to be backported to the legacy C++ driver.

            Assignee:
            adam.midvidy Adam Midvidy
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: