Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the limit on the number of array elements that can be passed to a MongoDB '$in' operator in a query?

How many elements can array contain in the following query?

db.collection.find({field: {$in: array}});
like image 499
Jeff Avatar asked Mar 10 '12 01:03

Jeff


1 Answers

Limit for $in(and any query) same as limit for document. Currently it's 16 mbs. Here is related thread Google groups.

like image 137
Andrew Orsich Avatar answered Nov 09 '22 08:11

Andrew Orsich