Rename Cursor/AsyncCursor to FindCursor/AsyncFindCursor

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Trivial - P5
    • 5.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Cursor/AsyncCursor is the cursor class returned by collection.find(). The name Cursor is overly generic — it says nothing about what distinguishes it from CommandCursor/AsyncCommandCursor, which is returned by commands like aggregate, listIndexes, and listCollections.

      Renaming to FindCursor/AsyncFindCursor makes the contrast immediately readable ("one comes from find, one comes from a command") and is consistent with the naming convention used in the Node.js and Java drivers.

      Definition of done

      • Rename AsyncCursorAsyncFindCursor and CursorFindCursor (and _RawBatchCursor_RawBatchFindCursor)
      • Rename pymongo/asynchronous/cursor.pypymongo/asynchronous/find_cursor.py (and sync equivalent)
      • Add deprecated aliases AsyncCursor = AsyncFindCursor and Cursor = FindCursor for backwards compatibility
      • Update changelog and public documentation

      Pitfalls

      • Cursor/AsyncCursor are part of the public API; deprecation aliases are required
      • All internal references, imports, and type annotations across the codebase need updating

            Assignee:
            Unassigned
            Reporter:
            Alex Clark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: