Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-440

Document behavior of using iterator_to_array() with a ChangeStream

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Docs
    • None

      The example for change stream iteration relies on a manual iteration loop and does not stop iteration when valid() is false. This is standard practice for iterating a tailable cursor.

      That said, some users may still end up using iterator_to_array() to collect events from a change stream. In that case, iteration will naturally stop when no more events are available. We should discuss this on the documentation for the watch() function, alongside any examples for manual iteration.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: