The follow array in each document has users Id that following this user.
For a certain user e.g. userId = “3”, Is it possible in one query to get the follower user’s name whose have “hasShare = true”?
Note that followers are in the follow array having their id, and details in the same collections
In this example, for userId 3, having 2 followers 1 & 4, userId 1 has the attribute “hasShare” = true (first doc), so the query result should be: {"name": "aaa"}
So the case here is similar to subqueries in relational db. So we have to find users where users Id are in an array, and this array is in one of the documents in the collection.
Do you think that the $lookup is mature enough to be working with data Sharding?
For large data, e.g. 1M users in above sample collection, do you think we might have a performance implication for using $lookup?