2

在我的程序中,我需要通过一些 json 属性加入 2 个或更多集合。

当我只运行 subsequence 方法时,它返回 json 对象数组,但是当我op.fromLiterals在我的光学计划中使用它时,它返回一个文档 uri 列表。

我无法使用该方法op.fromSearch,因为我无法升级到更高的 MarkLogic 版本。

我需要这样的东西才能工作:

var items = fn.subsequence(search).toArray();
op.fromLiterals(items)
.joinInner(article, op.on('fragmentId', 'viewDocId'))
.result()

但现在 items 是一个文档位置列表(document_1.json),这段代码给了我一个错误:

XDMP-ARGTYPE: xdmp.documentGet(cts.doc("/Documents/document_1.json"))

解决方案:我以这种方式将属性推送到结果中: results.push({id: doc.toObject()["document_id"]}); 它的工作正常。

4

0 回答 0