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

Ability to access previous document in $group aggregation

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.5.6
    • Aggregation Framework
    • Query Optimization

    Description

      When performing an aggregation query in mongodb, it would sometimes be useful to reference the previous document. As we have the `$$ROOT` variable, perhaps we could have `$$PREVIOUS` or some other meaningful name that let's us do document to document calculations.

      A possible use case would be calculating time passed in between documents more easily, and calculating deltas between documents.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            arg20 Gabriel Zimmermann
            Votes:
            8 Vote for this issue
            Watchers:
            19 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: