Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-103962

Make a DocumentSource which supports an iterator concept

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Inspired by SERVER-97356. We have the ability to return a batch of documents to feed a pipeline, and even to do so with a callback. We should extend this ability to allow a callback function to provide results in a stream. Something like this:

      class InputDataStream {
          virtual DocumentSource::GetNextResult getNext() = 0;
      };
      
      // allow constructing a DocumentSourceQueue with some implementation of the above.
      

      Conceptually, this might allow us to revert some pieces of SERVER-97356. We could re-implement new queue-like stages as a $queue, and keep all the special cases for $queue. I'm not sure it's worth changing the name back, but I like this design better.

            Assignee:
            Unassigned Unassigned
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: