Perform a search over multiple collections
Right now you can only search over one collection. I'd like to be able to search over several collections at the same time.
The work on performing a search over multiple collections started a while ago and we will update you here when it is released.
Starting in MongoDB 4.2, you can search over multiple collections with materialized views. For some use cases that is not idea, but for many it should work just fine. If it won't work in your case, please let us know why it would not.
Tim Frietas commented
i want to use searchBeta operator on dbref objects attribute how i can give instructions to analyzer to access fields from reference object and do indexing
For example, assuming the following two collections:
I want to be able to run a query like the following: