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

Enable larger result sets within $facet stage

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Case:

      Description

      SERVER-23654 introduced the $facet stage, which combines all outputs of the sub-pipelines into one result document. This is a request to enable some mechanism for returning more than 16MB of results, while still being able to process the same initial result set in multiple ways.

      Original Request

      I have several similar aggregation operations at the same time, for example

      db.cases.aggregate([
         {$match : query},
         {$unwind : "factors"},
       
         //operation 1 of the above result
         // ...
      ])
       
      db.cases.aggregate([
         {$match : query},
         {$unwind : "factors"},
       
         //operation 2 of the above result
         // ...
      ])
      

      The first two stages of aggregation( $match, $unwind ) are the same, and I think it would be a waste to repeat the duplicate stages. So I am asking if there exists a way to forking the pipeline, so that it can share the result from the first two stages, as follows,

      db.cases.aggregation([
         {$match : query},
         {$unwind : "factors"},
         forks : [
            {... operation 1},
            {... operation 2}
         ]
      ])
      

      http://stackoverflow.com/questions/38047527/fork-the-pipeline-of-aggregation

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-execution Backlog - Query Execution
              Reporter:
              profesor79 Greg
              Participants:
              Votes:
              3 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated: