How to aggreate 2 sharding collection?

Hi, i need to aggregate between 2 shard collection. But mongo do not allow that. Can i do it in another way? please help me.

I doubt that. Please provide sample documents from both collections. Also provide result documents. Make sure to explain the logic of how you aggregate documents from the source collections into the result.

Before posting your documents, please read Formatting code and log snippets in posts.

1 Like

I stand corrected. From https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/, I read:

Performs a left outer join to an unsharded collection in the same database to filter in documents from the “joined” collection for processing.

from Specifies the collection in the same database to perform the join with. The from collection cannot be sharded.

Of particular interest