Performing bulk search reads


I have a use case for performing bulk searches in short bursts of around 1000-5000 individual search terms.

I’d like to avoid 5000 separate network calls to perform each search, are there any aggregation stages that can perform the searches in bulk?

Hi @Anthony_Halliday – what expectations do you have for the search results? Would each one be unique to each query?

Hi @Elle_Shwer, yes exactly. I’d like to effectively run n,000 distinct searches in a batch.

And why do you want to avoid the network call? Just trying to understand, as I’m not sure we have a clean way to do this today.

Yes, I wasn’t sure it would be possible.

For short bursts of related queries, my initial instinct was to batch the searches into a single network operation. But perhaps that’s not the standard approach with MongoDB.