Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6242

AbstractCursor closed property turns true when cursor is exhausted rather than when it has completely been iterated

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.9.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a Mongosh engineer
      I want to know when all the documents from the cursor have been returned
      So that I can inform the user if there is more to "it"erate

      User Impact

      • Breaking change, close used to change to true when there were no more documents, now it changes to true when the cursor id becomes zero

      Dependencies

      • None

      Unknowns

      • Internally we probably have logic that now depends on this.

      Acceptance Criteria

      Implementation Requirements

      • Restore close's prior behavior
      • Move current behavior to new variable if necessary (possibly one of the other end states suffices already)

      Testing Requirements

      • Test that close means there are no more documents

      Documentation Requirements

      • Add API docs to all cursor properties but particularly ones that communicate state.
        • closed, killed, id (make a note about zero/nullish)

      Follow Up Requirements

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: