[SERVER-20169] aggregation: Should have a $range operator to generate a sequence. Created: 27/Aug/15  Updated: 22/Mar/17  Resolved: 24/Mar/16

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.3.4

Type: New Feature Priority: Minor - P4
Reporter: Craig Wilson Assignee: Benjamin Murphy
Resolution: Done Votes: 0
Labels: expression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-1621 aggregation: Should have a $range ope... Closed
is depended on by DOCS-8655 Document $range aggregation operator Closed
Related
related to DRIVERS-297 Aggregation Framework Support for 3.4 Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 12 (04/04/16)
Participants:

 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



 Comments   
Comment by Benjamin Murphy [ 24/Mar/16 ]

This ticket introduced the $range expression to the aggregation framework, with syntax as described in the ticket. Documentation will need to be added for the new expression, and drivers that have helpers for constructing agg frameworks will need to be expanded.

Comment by Githook User [ 24/Mar/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-20169 Aggregation now supports the range expressin.
Branch: master
https://github.com/mongodb/mongo/commit/f40294818ce8690f1a485ca32ea52e33e137b7ea

Comment by Charlie Swanson [ 11/Mar/16 ]

After some internal discussion, I've updated the description to comply with our agreed-upon design.

Generated at Thu Feb 08 03:53:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.