fn.subsequence work different in optic API

Viewed 47

In my program I need to join 2 and more collections by some json properties.

When I run only subsequence method it return array of json objects but when I use it in op.fromLiterals in my optic plan it returns a list of document uris.

I can't use the method op.fromSearch because I can't upgrade to a later MarkLogic version.

I need something like this to work:

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

But now items is a list of document locations (document_1.json) and this code gives me an error:

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

Solution: I push properties to results in this way: results.push({id: doc.toObject()["document_id"]}); and its work fine.

0 Answers
Related