Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 318 Bytes

sample.md

File metadata and controls

23 lines (18 loc) · 318 Bytes

Demo for Sample

Example of code

import {AggregateBuilder} from 'mongodb-aggregate-builder';

const aggBuilder = new AggregateBuilder();
aggBuilder.sample(3);
console.log(JSON.stringify(aggBuilder.build(), null, 2));

Result

[
  {
    "$sample": {
      "size": 3
    }
  }
]