aggregation: Should have a $range operator to generate a sequence.

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • 2.4
    • Affects Version/s: None
    • Component/s: LINQ
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Syntax

      {$range: [<start>, <end>, <step>]}
      

      Example

      Input

      {_id: 0}
      

      Pipeline

      db.coll.aggregate([{
          $project: {
              x: {$range: [0, 6, 2]}
          }
      }])
      

      Output

      {_id: 0, x: [0, 2, 4]}
      

      Additional Notes

            Assignee:
            Craig Wilson
            Reporter:
            Rathi Gnanasekaran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: