range

ReQL command: range

Command syntax

r.range() → stream
r.range([start_value, ]end_value) → stream

Description

Generate a stream of sequential integers in a specified range.

range takes 0, 1 or 2 arguments:

  • With no arguments, range returns an “infinite” stream from 0 up to and including the maximum integer value;
  • With one argument, range returns a stream from 0 up to but not including the end value;
  • With two arguments, range returns a stream from the start value up to but not including the end value.

Note that the left bound (including the implied left bound of 0 in the 0- and 1-argument form) is always closed and the right bound is always open: