ValuesSearch.match( $pattern as xs.anyAtomicType ) as ValuesSearch
Limits the values to those that match the pattern. Exclusive with respect to the groupInto() and aggregate() clauses.
Typically a string with a wildcard pattern (not a regex)
for matching the values from the index over the documents
selected by the |
// Find values of the author JSON property that begin with "m" and // that occur in documents in the /books/ directory. var jsearch = require('/MarkLogic/jsearch.sjs'); jsearch.values(['author']) .where(cts.directoryQuery('/books/')) .match("m*") .result() ==> ["Mark Twain"]