Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (47.6k points)

In the MongoDB shell, how do I list all collections for the current database that I'm using?

2 Answers

0 votes
by (106k points)

You can use the below-mentioned query to list all collections in the mongo shell:-

db.getCollectionNames()

0 votes
by (108k points)

Just type the following code in the mongo executable file:

db.getCollectionNames()

Related questions

0 votes
1 answer
asked Oct 5, 2019 in SQL by Tech4ever (20.3k points)
0 votes
2 answers
asked Sep 9, 2019 in SQL by Sammy (47.6k points)
0 votes
2 answers
0 votes
1 answer
asked Sep 4, 2019 in SQL by Sammy (47.6k points)
0 votes
2 answers

Browse Categories

...