mongo shell show all documents in collection code example
Example 1: see number of documents in mongodb collection
db.collection.count()
Example 2: show collection data in mongodb
db.collectionName.find()
Example 3: list all collections in the MongoDB shell
JavaScript (shell):
db.getCollectionNames()
Node.js:
db.listCollections()