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

db.getCollectionNames() returns empty array

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.8.0-rc0
    • Fix Version/s: None
    • Component/s: Shell, Usability
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      s571:27017 is running mongodb v2.8.0-rc0

      > /home/admin# mongodb-linux-x86_64-2.8.0-rc0/bin/mongo s571:27017/offerStore 
      MongoDB shell version: 2.8.0-rc0
      connecting to: s571:27017/offerStore
      offerstoreES:SECONDARY> rs.slaveOk()
      offerstoreES:SECONDARY> db.getCollectionNames()
      [
      	"TestCollection",
      	"offer",
      	"offerTimestamp",
      	"profiling",
      	"profiling_mr",
      	"system.indexes",
      	"system.profile",
      	"system.users"
      ]

      Test with an older shell fails:

      > /home/admin# mongodb-linux-x86_64-2.6.1/bin/mongo s571:27017/offerStore
      MongoDB shell version: 2.6.1
      connecting to: s571:27017/offerStore
      offerstoreES:SECONDARY> rs.slaveOk()
      offerstoreES:SECONDARY> db.getCollectionNames()
      []

      Show
      s571:27017 is running mongodb v2.8.0-rc0 > /home/admin# mongodb-linux-x86_64-2.8.0-rc0/bin/mongo s571:27017/offerStore MongoDB shell version: 2.8.0-rc0 connecting to: s571:27017/offerStore offerstoreES:SECONDARY> rs.slaveOk() offerstoreES:SECONDARY> db.getCollectionNames() [ "TestCollection", "offer", "offerTimestamp", "profiling", "profiling_mr", "system.indexes", "system.profile", "system.users" ] Test with an older shell fails: > /home/admin# mongodb-linux-x86_64-2.6.1/bin/mongo s571:27017/offerStore MongoDB shell version: 2.6.1 connecting to: s571:27017/offerStore offerstoreES:SECONDARY> rs.slaveOk() offerstoreES:SECONDARY> db.getCollectionNames() []

      Description

      Older mongodb shells (here v2.6.1) return an empty array on db.getCollectionNames() issued to a mongodb v2.8.0-rc0

      The v2.8.0-rc0 shell returns correctly the collection names.

      It would be nice if mongodb 2.8.0 returns a result which is compatible for mongodb shells older than 2.8.0, if possible.

      This might also be the reason that the latest pymongo (v2.7.2) driver can't read collection names from mongodb 2.8.0-rc0.
      See also: https://jira.mongodb.org/browse/PYTHON-790

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: