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

Implement Collection::aggregate()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Since Phongo is not using libmongoc's aggregation helper, we'll need to abstract inline results and command cursors for the user. Our aggregate() helper should always return an iterable object.

      Note that the useCursor option's default value is based on the server version. I assume we get this from the most recent topology state, but it's unclear how it may vary if we're communicating with a mixed version replica set (unless we do server selection before calculating the default?).

      Usage example:

      $collection->aggregate(
          // Required pipeline param
          [
              ['$match' => ['x' => 1]],
              ['$skip' => 10],
          ],
          // Optional named params in an associative array
          ['allowDiskUse' => true]
      );
      

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

              Created:
              Updated:
              Resolved: