ValuesSearch.match

ValuesSearch.match(
   pattern as xs.anyAtomicType
) as ValuesSearch

Summary

Limits the values to those that match the pattern. Exclusive with respect to the groupInto() and aggregate() clauses.

Parameters
pattern Typically a string with a wildcard pattern (not a regex) for matching the values from the index over the documents selected by the where clause.

See Also

Example


// Find values of the author JSON property that begin with "m" and 
// that occur in documents in the /books/ directory.
const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.values(['author'])
  .where(cts.directoryQuery('/books/'))
  .match("m*")
  .result()

// Result: ["Mark Twain"]
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy