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:
Thomas Sibley authored and GitHub committed 2025-05-14 20:46:31 +09:00
1 parent a8f27cc4db
commit 931a362f8b
4 files changed
+22 -22

No files matched your search

+4 -4
View File
@@ -942,14 +942,14 @@ def while(cond; update): def _while: if cond then ., (update | _while) else empt
1
[1,2,4,8,16,32,64]
truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])
truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])
1
[[0],2]
[[0],"b"]
[[0]]
fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))
fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))
null
[2]
["b"]
. as $dot|fromstream($dot|tostream)|.==$dot
[0,[1,{"a":1},{"b":2}]]