Contents of page >
- 1) See list of all tables (collections) in database in MongoDb >
- 2) See list of all tables (collections) in different database in MongoDb >
1) See list of all tables (collections) in database in MongoDb >
We can use following ways to see list of all collections in database in MongoDb >
> show collections
OR
> show tables
OR
> db.getCollectionNames()
|
2) See list of all tables (collections) in different database in MongoDb >
> use myb;
switched to db mydb
> show collections
employee
system.indexes
>
|
First we switched to database mydb, and then saw all collections in it.
SUMMARY>
So in this mongoDB tutorial we learned how to See list of all tables (collections) in database in MongoDb. We must use show collections.
Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.
RELATED LINKS>
What is MongoDB - A quick introduction to database
Create new database in mongoDB
Labels:
MongoDB