Reputation: 148
I'm creating a Meteor App where the user selects a database & views all its collections. I want to enlist all the databases & their collections that my mongo server currently has in my homepage but I cannot see how that is done. Please help, Thank you.
Upvotes: 1
Views: 1765
Reputation: 2647
Using the shell you can list all the databases using
db.adminCommand( { listDatabases: 1 } )
Then you can list all the collections with
db.getCollectionNames()
Meteor will most likely have a wrapper for these commands.
Upvotes: 1