I am wondering what the best strategy would be. We need to query a rather large collection of currently 24m rows.
We search on 2 indexed fields, but to narrow down the query even further, we have an array of up to 10k user ids that could be added to the query. Since the existing query is already an $or query, we needed to add the array twice, resulting in totally 20k ids being transported to Atlas.
Is this a bad idea? Would be it wiser to simply omit the 20k array, and then instead filter the results once they arrive - in code?
Thanks in advance