[SERVER-3467] Make the upper index limit in an $in query more explicit Created: 22/Jul/11 Updated: 30/Mar/12 Resolved: 22/Aug/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Wes Widner | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Participants: |
| Description |
|
While hunting for what we though were missing documents in our collection, I discovered that $in queries have an upper limit of around 5,000 items. Does this sound about right? |
| Comments |
| Comment by Aaron Staple [ 23/Jul/11 ] |
|
It looks like your selectfromArr array has 12642 elements but only 5921 distinct elements. |
| Comment by Wes Widner [ 22/Jul/11 ] |
|
$in query with lots of elements |
| Comment by Wes Widner [ 22/Jul/11 ] |
|
I wrote an $in query which used an array with about 12,000 elements in it. I'll include the query as an attachment. When I run it, only ~5000 records are returned at a time which seems to indicate that there is an upper limit on how many elements an array can have in an $in query. |
| Comment by Eliot Horowitz (Inactive) [ 22/Jul/11 ] |
|
No - that doesn't make sense... |