如何将xquery代码转换为javascript。我熟悉Xquery,正在学习转换为Marklogic JavaScript。谢谢。
xquery version "1.0-ml";
declare namespace rec="http://mod.com/record";
declare namespace meta="http://mod.com/record/meta";
let $uris := cts:uris(
(),
(),
cts:and-query((
cts:collection-query("/document/pdf"),
cts:element-value-query(xs:QName("rec:PdfExists"),"1")
cts:element-value-query(xs:QName("meta:Access"), ("2150951","2148831","2141426")
)
))
)
return $uris
答案 0 :(得分:2)
尽管我没有测试过,但这是语法上正确的等效项:
cts.uris(
"",
[],
cts.andQuery([
cts.collectionQuery("/document/pdf"),
cts.elementValueQuery(fn.QName("http://mod.com/record", "PdfExists"),"1"),
cts.elementValueQuery(fn.QName("http://mod.com/record/meta", "Access"), ["2150951","2148831","2141426"])
])
)