简体   繁体   中英

Marklogic structured query in server side javascript or node.js

Is it possible to perform a structured query on server side javascript (via cts.* or jsearch.* ) or on Node.js API?

According to documentation ( https://docs.marklogic.com/guide/search-dev/structured-query#id_47703 ) it might only be possible only via XQuery, Java or REST API.

I was under the impression that XQuery and server side javascript implementation be have the same functionalities.

Equivalent expressive power does not necessarily mean identical interfaces.

Structured query is primarily intended for use with the REST, Java, and Node.js Client APIs. Use the Node.js Client API queryBuilder interface to construct a structured query. See http://docs.marklogic.com/guide/node-dev/search#id_28266 .

Alternatively, if you do not want to use the builder for some reason, you can roll your own combined query that contains a structured query. See http://docs.marklogic.com/guide/node-dev/search#id_57610 .

On the server side, the recommended search API for JS is jsearch. See http://docs.marklogic.com/js/jsearch and http://docs.marklogic.com/guide/search-dev/javascript#chapter . Jsearch operates on cts:queries. Structured query is really just a thin layer over cts:query.

It is possible to call search:resolve (as search.resolve) from JS, just like any other XQuery library, but it is XML-centric, so it is not very convenient to use it from JS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM