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

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

    XMLWordPrintable

    Details

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benjamin.murphy Benjamin Murphy
              Reporter:
              craiggwilson Craig Wilson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: