with one-to-many relationship. One product can have many product components. When I do a query with lookup it is too slow. I am just trying to retrieve 1000 documents from 3000. Do I have to add any index?
Your product component collection must absolutely have an index on the field by which you are doing the $lookup (most likely that’s product_id?). If you provide the actual pipeline that’s slow along with what version, etc you are running we might be able to help further.