I have one query regarding search implementation. Here search implementation or atlas-search is best suitable for search in a single collection. I think normally we faced a scenario where we need to search with populate or ref collection also. How can I do it with better implementation?
Consider the very simple scenario where I have 2 collections.
1 Product (text index of product name field)
2 User (text index on username fields may be firstName, lastName etc)
The user create the products so in product collection there is ref on
**createdBy** with user’s MongoID. On Frontend, there is a listing of products so I need to provide search criteria like below in single text search
- I can search with product name
- I can search with the name of the owner of the product
What is the best way to handle such a scenario with MongoAtlas? ex. I want all products created by “Donni Bachhan”. what is the aggregation pipeline you just or best practise for it