-
Type: New Feature
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Fully Compatible
-
Query 12 (04/04/16)
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
- Should have same semantics as python's range function
- Errors on any non-numeric arguments
- Errors on any non-integral values. Specifically, this code.
- is depended on by
-
CSHARP-1621 aggregation: Should have a $range operator to generate a sequence.
- Closed
- related to
-
DRIVERS-297 Aggregation Framework Support for 3.4
- Closed