Add accessors for Cursor.Current and ChangeStream.Current

XMLWordPrintableJSON

    • 🔵 Done
    • Go Drivers
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      It’s clunky to iterate a cursor via an interface presently because the only way to fetch the current document is via the .Cursor struct member. The workaround is to define a “dummy” type that implements all the methods needed as wrappers around the cursor type. Adding an accessor to the driver’s types simplify that nicely.

      It would also make the API a bit more consistent: right now all interaction with those types happens via methods except reading the actual document.

      Definition of done

      Add an accessor that returns the .Cursor member.

      Pitfalls

      None that I can see.

            Assignee:
            Preston Vasquez
            Reporter:
            Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: