In MongoDB, the $sampleRate
aggregation pipeline stage matches a random selection of input documents.
The number of documents selected approximates the sample rate expressed as a percentage of the total number of documents.
The $sampleRate
operator was introduced in MongoDB 4.4.2.