MarkLogic Server 11.0 Product Documentation
AccessPlan.prototype.sampleBy

AccessPlan.prototype.sampleBy(
   [options as String]
) as ModifyPlan

Summary

This function samples rows from a view or from a pattern match on the triple index.

Parameters
options Options consisting of key-value pairs that set options. At present, the options consist of limit, which can take a numeric value to specify the size of the sample. The default value is 100.

Usage Notes

This method can only be used directly after op.fromView , op.fromTriples or op.fromLexicons .

Example

const op = require('/MarkLogic/optic');

op.fromView('opticUnitTest', 'musician')
  .sampleBy({limit:20})
  .result()
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy