DBClientWithCommands::getCollectionInfos fails against mongodb < 2.7

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 (Inactive)
              Reporter:
              Andrew Morrow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: