Loading TOC...

ValuesSearch.where

ValuesSearch.where(
   $queries as cts.query
) as ValuesSearch

Summary

Specifies which documents have values in the index. Omit the where() clause to retrieve all values in the index.

Parameters
$queries One or an array of cts.query objects matching documents. Some helper functions such as cts.parse() and jsearch.byExample() return a cts.query object.

Usage Notes

Apply this method to the output from jsearch.values. You can optionally follow it with "clauses" such as orderBy slice, or map. Results are not generated until you call ValuesSearch.result.

You can construct the input queries using cts.parse, jsearch.byExample, a cts.query constructor such as cts.jsonPropertyWordQuery or cts.elementValueQuery, or any other function that returns a cts.query object.

See Also

Example


// Find values of the author JSON property that occur in documents
// in the /books/ directory.
var jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.values(['author'])
  .where(cts.directoryQuery('/books/'))
  .result()

==> ["John Steinbeck", "Mark Twain", "Robert Frost"]
   

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy