Say we have 2 collections in a Mongo Atlas database.
- Users
- Inventory
Users has name and userId
Inventory has inventoryId, userId
I want to search for all the inventory items by name of the user. There can be multiple entries in the user table with the same name. What is an efficient way to do this, which can also handle a lot of documents in these 2 collections?