2

Given the expression

{WorkProduct: {$in:[0001,0002,0003,...]}

Is there a limit to the number of items I can query against ?

johnr
  • 98
  • 6
Barry Mullan
  • 102
  • 5

1 Answers1

3

Our API forces no limit but the overall query we send to our underlying engine must be smaller than 4MB. Even allowing for overhead, theoretically, you could put a couple hundred thousand entries in an $in clause before hitting that.

So, that's the theory and absolute limit. I suspect you'll hit a practical limit long before then because $in clauses perform on the order of m * Log (n), where n is the number of elements in the collection and m is the number of elements in your $in clause. So, there will be a linear slow down with the number of elements in the $in clause.

Larry Maccherone
  • 9,393
  • 3
  • 27
  • 43