How to list all collections in the mongo shell?
In the MongoDB shell, how do I list all collections for the current database that I'm using? AdaTheDev You can do... JS (shell): db.getCollectionNames() node.js: db.listCollections() non-JS (shell only): show collections The reason I call that non-JS is because: $ mongo prodmongo/app --eval "show collections" MongoDB shell version: 3.2.10 connecting to: prodmongo/app 2016-10-26T19:34:34.886-0400 E QUERY [thread1] SyntaxError: missing ; before statement @(shell eval):1:5 $ mongo prodmongo/app --eval "db.getCollectionNames()" MongoDB shell version: 3.2.10 connecting to: prodmongo/app [ "Profiles