MongoDB shellCollectionNames malfunctioning

When in mongo shell 3.x I found this strange behavior:

  • Entering db.getCollectionNames () I get [], but I know that there are collections
  • Typing db.myColl.findOne () actually returns the document as I expect

Does anyone know why? Thanks

+4
source share
2 answers

You are already at 3.x. so this should not have any influence that I accept?

docs.mongodb.com/manual/reference/method/db.getCollectionNames as the link says it returns an empty array for the shell below 3.X

+2
source

MongoDB 3.0 WiredTiger, db.getCollectionNames() mongo 3.0 3.0, , db.getCollectionNames() , .

.

+1

All Articles