Class DataSizeExpressions

java.lang.Object
dev.morphia.aggregation.expressions.DataSizeExpressions

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

    • binarySize

      public static Expression binarySize(Object value)
      Returns the size of a given string or binary data value’s content in bytes.
      Parameters:
      value - the value to examine
      Returns:
      the new value
      Since server release
      4.4
      MongoDB documentation
      Aggregration Expression: $binarySize
    • bsonSize

      public static Expression bsonSize(Object value)
      Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON.
      Parameters:
      value - the value to examine
      Returns:
      the new expression
      Since server release
      4.4
      MongoDB documentation
      Aggregration Expression: $bsonSize