I'm interested in getting back a specific range of results, say from 99 to 199, or, perhaps, the last JSON
object. While this works for small numbers or ranges, how can it be generalized or expanded to a larger range?
xquery version "3.0";
for $i in (1,2,3)
for $line in db:open("json_people")
return $line/json/_[$i]
You can avoid the nested loop, use the position()
function and specify a range:
db:open("json_people")/json/_[position() = 99 to 199]