Class DataSizeExpressions


  • public final class DataSizeExpressions
    extends Object
    Defines helper methods for the data size expressions
    Since:
    2.1
    • Method Detail

      • binarySize

        public static Expression binarySize​(Expression expression)
        Returns the size of a given string or binary data value’s content in bytes.
        Parameters:
        expression - the binary size expression
        Returns:
        the new expression
        MongoDB documentation
        Aggregration Expression: $binarySize
      • bsonSize

        public static Expression bsonSize​(Expression expression)
        Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON.
        Parameters:
        expression - the bson size expression
        Returns:
        the new expression
        MongoDB documentation
        Aggregration Expression: $bsonSize