get list of all collection in mongodb code example
Example 1: list all collections in the MongoDB shell
JavaScript (shell):
db.getCollectionNames()
Node.js:
db.listCollections()
Example 2: get all data in collection mongodb
db.collection_name.find().pretty()