Do not close cursor in the shell when cursor reaches limit

XMLWordPrintableJSON

    • Query Execution
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • QE 2024-07-08
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The tests exhaust.js fails when sbe is enabled and when the number of docs to return is equal to the batchSize. SBE requires one additional getMore call to fully exhaust the cursor. However, in the shell, the hasNext method https://github.com/10gen/mongo/blob/master/src/mongo/shell/query.js/#L244 closes the cursor when the cursor has seen limit docs. The cursor still has the moreToCome bit set and returns information about this cursor when the next query is called. The shell should not close the cursor in this case. The server already handles exhaust cursors properly: only closes them once moreToCome is unset. 

            Assignee:
            Adi Agrawal (Inactive)
            Reporter:
            Adi Agrawal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: