MongoDB can be used locally or hosted on cloud , in any case MongoDB Compass is a great tool for managing collections.
Compass come with a console, which you can use manipulate docs. Let’s learn how to explore collection
List all collection
we can list collection using the following on terminal/ Compass console
use myDB db.getName() -- will show your database name db.getCollectionNames()
Here use myDB is is used to change the database and getName will populate all collection names. We can access the collection using db.< collection>.find() to list all json documents inside it.
You may also love to read following tutorials
- How to list all documents in MongoDB collection - How to list all documents in MongoDB collection using console.