Can I get all collection's data in a single request?

I am working a project where I create database for every organization.I mean we have a core database for our important details and every organization has a database for their data.If we will have 100 organization we will have 100 database. We did this for our client requirments.So,Is there any solution to get all collection data of a database in a single query??

Hi @Moyen_Islam,

We did this for our client requirments.So,Is there any solution to get all collection data of a database in a single query??

I believe there isn’t a directly a single command available currently that would retrieve all documents from all collections in a single database.

One idea could be to possibly use listCollections and then pass the resulting collection names to a script which runs the query for the data you require.

Regards,
Jason

I think we’ve connected in the past Moyen, so pardon any repetition, but you will be able to do this shortly and easily using Atlas Data Federation.

Is use case to basically have something like:
Db1.CollEvents
Db2.CollEvents
Db3.CollEvents

And be able to query GlobalDB.CollEvents and have this represent data from each of the 3 CollEvents above?

2 Likes