docs: Use a better input example in the streaming section (#3322)
The introduction says all the usage examples (e.g. of truncate_stream, etc) in the section use [0,[1]] as input, but they actually use [1,[2]]. ["a",["b"]] seems better than [1,[2]] as the string values won't be confusable with the indexes in <path>.
This commit is contained in:
1 parent
a8f27cc4db
commit
931a362f8b
4 files changed
+22
-22
No files matched your search
@@ -3384,8 +3384,8 @@ sections:
|
||||
|
||||
Several builtins are provided to make handling streams easier.
|
||||
|
||||
The examples below use the streamed form of `[0,[1]]`, which is
|
||||
`[[0],0],[[1,0],1],[[1,0]],[[1]]`.
|
||||
The examples below use the streamed form of `["a",["b"]]`, which is
|
||||
`[[0],"a"],[[1,0],"b"],[[1,0]],[[1]]`.
|
||||
|
||||
Streaming forms include `[<path>, <leaf-value>]` (to indicate any
|
||||
scalar value, empty array, or empty object), and `[<path>]` (to
|
||||
@@ -3402,9 +3402,9 @@ sections:
|
||||
given streaming expression.
|
||||
|
||||
examples:
|
||||
- program: 'truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])'
|
||||
- program: 'truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])'
|
||||
input: '1'
|
||||
output: ['[[0],2]', '[[0]]']
|
||||
output: ['[[0],"b"]', '[[0]]']
|
||||
|
||||
- title: "`fromstream(stream_expression)`"
|
||||
body: |
|
||||
@@ -3413,9 +3413,9 @@ sections:
|
||||
outputs.
|
||||
|
||||
examples:
|
||||
- program: 'fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))'
|
||||
- program: 'fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))'
|
||||
input: 'null'
|
||||
output: ['[2]']
|
||||
output: ['["b"]']
|
||||
|
||||
- title: "`tostream`"
|
||||
body: |
|
||||
|
||||
Reference in new issue
Block a user