I had one big collection which is now seprated/divided into 2 collections. And now I would like to retrieve the documents from both of them through a single mongo query.
The only solution I can think of as of now is to write 2 query on those 2 collections seprately and then merge the result at the application level!
I want to achieve this on the db layer itself because the number of documents that I have after combining both the collections is beyond 1 million!!
Ex:
CollectionA: {field_1: "abc", field_2: "xyz", field_3: "abcxyz"},
{field_1: "def", field_2: "ghi", field_3: "defghi"}
CollectionB: {field_1: "qwe", field_2: "rty", field_3: "qwerty"}
Result: {field_1: "abc", field_2: "xyz", field_3: "abcxyz"},
{field_1: "def", field_2: "ghi", field_3: "defghi"},
{field_1: "qwe", field_2: "rty", field_3: "qwerty"}