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

Ability to access previous document in $group aggregation

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.6
    • Component/s: Aggregation Framework
    • Query Optimization

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            arg20 Gabriel Zimmermann
            Votes:
            8 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: