How can I list all collections by restful api?

Hi, I need to mange the collections by api, do we have any restful api endpoint to list all collections in Mongo DB Atlas?

Hi @Rusty_Geng,

You can consider using Atlas App Services functions, specifically the database.getCollectionNames() API. Whats the use case here out of curiosity?

Have you tried doing this via a driver? The listCollections command should be able to get the output you need.


Thanks, I have tried via driver, but it requires the connection string for each mongoDB cluster. I would like to ask if there is API endpoint like administration API, we can get some data from cluster that we need by API keys.

I don’t think this is available on the Atlas Administration API. Do you have any more use case details here with regards to managing the collections? Curious to know how many clusters and whether the app services function works?

Thanks, I will try to use the Atlas App Services functions.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.