I was trying some examples from the JSONiq document, but it throws error for some of the snippets from the document.
I have installed jsoniq (version 0.0.8) using npm.
Example :
if(1 + 1 eq 2)
then { "foo" : "yes" }
else { "foo" : "false" }
Error :
jsoniq run test.jq
/source/lib/compiler/Translator.ts:117
throw new Error("Invalid query plan.");
^
Error: Invalid query plan.
at Translator.compile (/source/lib/compiler/Translator.ts:117:19)
at JSONiq.compile (C:\ravindra\Setup\node-v14.15.5-win-x64\node_modules\jsoniq\dist\lib\JSONiq.js:60:29)
at Command.<anonymous> (/source/lib/cli/Main.ts:15:20)
at Command.listener (C:\ravindra\Setup\node-v14.15.5-win-x64\node_modules\jsoniq\node_modules\commander\index.js:315:8)
at Command.emit (events.js:315:20)
at Command.parseArgs (C:\ravindra\Setup\node-v14.15.5-win-x64\node_modules\jsoniq\node_modules\commander\index.js:651:12)
at Command.parse (C:\ravindra\Setup\node-v14.15.5-win-x64\node_modules\jsoniq\node_modules\commander\index.js:474:21)
at Object.<anonymous> (/source/lib/cli/Main.ts:53:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
Is this code snippet invalid?
Few other snippets also throw the above error.
It would be of great help if anyone can point me to the latest/valid documentation or let me know if this syntax is no longer valid.
Yes, the snippet is correct. If it does not work, then it is specific to this implementation.
Rumble is actively supported and easy to install. It works on many file systems (your own disk, S3, HDFS...) and at many scales (small files all the way to billions of records).
You can also directly type (small) JSONiq queries into the public sandbox to play around. This is a Jupyter notebook pre-populated with queries taking you through a JSONiq tutorial.