Search notes:

jq: range

$ jq -n 'range(5)'
0
1
2
3
4
5
$ jq -n '[range(3)]'
[
  0,
  1,
  2
]
Compare the following command with jq -n {id: (1,2,3)} (which returns the same result):
$ jq -n '{id: range(3) }'
{
  "id": 0
}
{
  "id": 1
}
{
  "id": 2
}
$ jq -n '{x: range(2), y: range(2) }'
{
  "x": 0,
  "y": 0
}
{
  "x": 0,
  "y": 1
}
{
  "x": 1,
  "y": 0
}
{
  "x": 1,
  "y": 1
}

Index