Closed ingomueller-net closed 5 years ago
Thanks, Ingo.
This is not a syntax error. [0] filters for a sequence position (in this case, the sequence only one has one array), but positions start at 1, so $o.choices[0] should return an empty sequence. Then, eq returns () as well and where should be false, so the overall query should return ().
But there is indeed a bug in our iterators that we need to fix.
FYI if you need the first choice, then the syntax for this should be
$o.choices[[1]]
(array lookup is [[ ]], and positions start at 1 in JSONiq).
OK, I think I understand the difference now. So, as you say, it's only the problem with the iterator.
I am happy to announce that this is now solved :)
The following query (where array access
[[0]]
is mistakenly written as array constructor[0]
) causes a job abortion:I guess a syntax error (or at least some more high-level error) would be more appropriate.