Reputation: 135
When in mongo shell 3.x I found this strange behaviour:
Does anyone know why? Thanks
Upvotes: 5
Views: 1916
Reputation: 16335
For MongoDB 3.0 deployments using the WiredTiger storage engine, if you run db.getCollectionNames() from a version of the mongo shell before 3.0 or a version of the driver prior to 3.0 compatible version, db.getCollectionNames() will return no data, even if there are existing collections.
FOr more details, refer here
Upvotes: 1
Reputation: 175
You're already on 3.x. so this shouldn't have any impact i take ?
docs.mongodb.com/manual/reference/method/db.getCollectionNames as the link says it returns empty array for shell lower than 3.X
Upvotes: 2