MarkLogic 12 Product Documentation
cts:bind-query-params

cts:bind-query-params(
   $query as cts:query,
   $params as map:map
) as cts:query

Summary

Replace parameters in a query with actual values.

Parameters
query Input query of which to replace the parameters.
params A map of parameter name to value bindings, where each key is the name passed to cts:param() and the corresponding value replaces that parameter in the query.

Example

xquery version "1.0-ml";
let $query-template:=cts:word-query(cts:param("wordParam"))
return cts:bind-query-params($query-template,map:entry("wordParam","cat"))

=> cts:word-query("cat", ("lang=en"), 1)

Powered by MarkLogic Server | Terms of Use | Privacy Policy