Loading TOC...

ValuesSearch.result

ValuesSearch.result(
   type as string
) as Iterable

Summary

Executes the values search definition and returns an array or object depending on whether the results are generated by default, with a mapper, or with a reducer.

Parameters
type Specifies 'value' (the default) to return a value (an array unless reducing) or 'iterator' to return a streaming iterator over the values.

Usage Notes

This function can return an array or an object, depending on how the results are generated (the default results, by a mapper, or by a reducer).

See Also

Example


const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.values(cts.jsonPropertyReference('event'))
  .where(cts.wordQuery('hazard'))
  .orderBy('frequency', 'descending')
  .slice(0, 100)
  .map({frequency: 'fragment'})
  .result();
   

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