我正在尝试 JSONiq 文档中的一些示例,但它会为文档中的某些片段抛出错误。
我已经使用 npm 安装了 jsoniq(版本 0.0.8)。
例子 :
if(1 + 1 eq 2)
then { "foo" : "yes" }
else { "foo" : "false" }
错误 :
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)
此代码段无效吗?
很少有其他片段也会引发上述错误。
如果有人可以向我指出最新/有效的文档,或者让我知道此语法是否不再有效,那将非常有帮助。