What happens when you set $lookup's from field to a sharded collection?

I didn’t see any mention of this in the documentation or anywhere else online.

For the $lookup stage, the documentation says that “the from collection cannot be sharded.”

So what happens when the from collection is sharded? What sort of error will I expect to see?

Also, I would love a little high-level reasoning as to why this constraint exists/must exist.

Give it a try and see what error message you get. If you did M103, you can use that VM as your sandbox.

For a high-level reason, have a look at this JIRA.

1 Like