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