How do I list all collections for the current database that I'm using?
show collections
show tables
db.getCollectionNames()
show dbs
use databasename
show collections
Output:
collection1 collection2 system.indexes
(or)
show tables
Output:
collection1 collection2 system.indexes
(or)
db.getCollectionNames()
Output:
[ "collection1", "collection2", "system.indexes" ]
use collectionname