【发布时间】:2020-09-17 18:03:55
【问题描述】:
'use strict'; declareUpdate();
const es = require('/MarkLogic/entity-services/entity-services.xqy');
const person = require('/es-gs/person-1.0.0-conv.xqy');
for (const source of fn.collection('raw')) {
let instance = person.extractInstancePerson(source);
let uri = '/es-gs/env/' + instance.id + '.xml';
xdmp.documentInsert(
uri, person.instanceToEnvelope(instance, "xml"),
{collections: ['person-envelopes']}
);
}
我从 marklogic 网页中获取了以下代码 link to site
我收到以下错误。我正在一步一步地按照指示进行任何想法
[javascript] XDMP-MODNOTFOUND: const person = require('/es-gs/person-1.0.0-conv.xqy');
-- Module /es-gs/person-1.0.0-conv.xqy not found
Stack Trace
At line 4 column 15:
我有 /es-gs/person-1.0.0-conv.xqy 它存在
【问题讨论】:
-
不确定它是否是代码示例中的 typeo,或者您真正运行的是什么,但 entity-services.xqy 需要一个破折号,而不是空格,分隔:`/MarkLogic/entity-services/entity services .xqy'
-
抱歉有一个破折号我会编辑和更正
-
我只是将代码复制并粘贴到 MarkLogic 大学 VM 的 Qconsole 之一中
标签: javascript json marklogic