I have a MongoDB
database with about 100
collections. The collections are very similar to each in structure, but the data is different enough that I need to keep the entries in the collections separate. So I am trying to figure out how I can aggregate all the individual collections into a single collection under different keys
.
For example, my database currently has the collections:
collection_set_A
collection_set_B
collection_set_C
collection_set_D
...
and I would like to have a single collection that looks like this:
collection_set
|
+-collection_set_A
+-collection_set_B
+-collection_set_C
+-collection_set_D
+-...
So that collection_set_A
can now be accessed as collection_set['collection_set_A']
.
Is this possible? I have seen a lot of references to map/reduce
, but those seem to be more for joining data, and not full collections like this. I'm basically wanting to move data, not join it.
Does anyone know if this is possible?