Class Miscellaneous


  • public final class Miscellaneous
    extends Object
    Defines miscellaneous operators for aggregations.
    Since:
    2.2
    • Method Detail

      • sampleRate

        public static Filter sampleRate​(double rate)
        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.
        Parameters:
        rate - the rate to check against
        Returns:
        the filter
        Since:
        2.2
        MongoDB documentation
        Aggregration Expression: $sampleRate