Hi,
I have a primary collection “collection1” and an archived Collection “collection2”. Both contain similar data. “collection2” contains data that is older than 3 years. Latest 3 years of data is available in “collection1”. The application queries “collection1” alone. Is there a way where we can internally search “collection2” incase data does not exist in “collection1” within MongoDB rather than modifying the application code.
Scenario - The application queries for certain data from collection1. If data does not exist in that collection, there has to be an internal mechanism to query collection2 and fetch it to the application.
Any suggestions would be appreciated. Thank you.