Loading TOC...

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"]
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.