MarkLogic 12 Product Documentation
cts.bindQueryParams

cts.bindQueryParams(
   query as cts.query,
   params as Object
) 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

const queryTemplate=cts.wordQuery(cts.param("wordParam"))
cts.bindQueryParams(queryTemplate,{"wordParam":"cat"})

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

Powered by MarkLogic Server | Terms of Use | Privacy Policy