[SERVER-16224] db.getCollectionNames() returns empty array Created: 18/Nov/14  Updated: 18/Nov/14  Resolved: 18/Nov/14

Status: Closed
Project: Core Server
Component/s: Shell, Usability
Affects Version/s: 2.8.0-rc0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kay Agahd Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-15987 listCollections and getIndexes empty ... Closed
is related to PYTHON-790 pymongo 2.7.2 collection_names() retu... Closed
Operating System: ALL
Steps To Reproduce:

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()
[]

Participants:

 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



 Comments   
Comment by Kay Agahd [ 18/Nov/14 ]

Yes, we are using wired tiger.
Ok, good to know that we have to update our mongodb shells (and drivers) as well.

Comment by Scott Hernandez (Inactive) [ 18/Nov/14 ]

I suspect you are seeing this behavior due to using an alternate storage engine, like wiredtiger. If so, you will need to use the latest driver/shell, and this is expected behavior requiring an updated client.

Generated at Thu Feb 08 03:40:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.