[CSHARP-1030] Using Sort with Custom Batch Size Created: 12/Aug/14 Updated: 05/Apr/19 Resolved: 12/Aug/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.9.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Critical - P2 |
| Reporter: | Jeff Lemmerman | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
C# Driver 1.9.2 against single node MongoDB 2.4.4 running on Windows Server 2008R2 with 4GB RAM. |
||
| Issue Links: |
|
||||
| Description |
|
The query below does not get results beyond the configured batch size (set to 1000). Removing the .SetSortOrder portion of the statement, the query functions as expected and retrieves results beyond initial batch size. However, the results are not sorted as desired. var cursor = comps.Find(Query.EQ("ExperimentNumber", experimentNumber)).SetSortOrder(SortBy.Ascending("SerialNumber", "DateTime")); Not including a batch size, the following error is thrown: ). Both SerialNumber and DateTime are ascending indexes for the collection. I would like to understand what is necessary to create a query with a sort and page through results using a custom batch size. |