Using Sort with Custom Batch Size

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Critical - P2
    • None
    • Affects Version/s: 1.9.2
    • Component/s: None
    • Environment:
      C# Driver 1.9.2 against single node MongoDB 2.4.4 running on Windows Server 2008R2 with 4GB RAM.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
      QueryFailure flag was too much data for sort() with no index. add an index or specify a smaller limit (response was

      { "$err" : "too much data for sort() with no index. add an index or specify a smaller limit", "code" : 10128 }

      ).

      Both SerialNumber and DateTime are ascending indexes for the collection.
      Total index size on collection is 1.1 GB.

      I would like to understand what is necessary to create a query with a sort and page through results using a custom batch size.

            Assignee:
            Unassigned
            Reporter:
            Jeff Lemmerman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: