Reputation: 1693
mongodb db.getCollectionNames()
command will give you all collection names what are all there in the current db, in a list.
I want the same output using pymongo. I googled some time and couldn't find anything like that.
Is anything like that exists ?
Upvotes: 6
Views: 9614
Reputation: 13406
Since pymongo 3.7, collection_names()
is deprecated and the correct way to get collection names is list_collection_names()
Upvotes: 3
Reputation: 113517
collection_names()
Will show you the collections of the current database.
From documentation:
collection_names()
Get a list of all the collection names in this database. [read more]
Upvotes: 8