0 votes
in MongoDB by
Can Mongos $in operator help here in MongoDB? Can $in handle an array of 10,000,000 entries in MongoDB?

1 Answer

0 votes
by

Honestly, if you can’t fit “Posts” into “Users”, then you have two options.

Denormalize some User data inside of posts. Then you can search through just the one collection.

Do two queries. (one to find users the other find posts)

Based on your question, you’re trying to do #2.

Theoretically, you could build a list of User IDs (or refs) and then find all Posts belonging to a User$in that array. But obviously that approach is limited.

Related questions

0 votes
asked Jun 3, 2020 in MongoDB by Robindeniel
0 votes
asked Jun 3, 2020 in MongoDB by Robindeniel
...