Uses of Class
dev.morphia.aggregation.experimental.expressions.impls.Expression
-
-
Uses of Expression in dev.morphia.aggregation.experimental
Methods in dev.morphia.aggregation.experimental with parameters of type Expression Modifier and Type Method Description Aggregation<T>
Aggregation. sortByCount(Expression sort)
Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.Aggregation<T>
AggregationImpl. sortByCount(Expression sort)
-
Uses of Expression in dev.morphia.aggregation.experimental.codecs
Classes in dev.morphia.aggregation.experimental.codecs with type parameters of type Expression Modifier and Type Class Description class
ExpressionCodec<T extends Expression>
Methods in dev.morphia.aggregation.experimental.codecs with parameters of type Expression Modifier and Type Method Description static void
ExpressionHelper. expression(Mapper mapper, org.bson.BsonWriter writer, Expression expression, org.bson.codecs.EncoderContext encoderContext)
static void
ExpressionHelper. expression(Mapper mapper, org.bson.BsonWriter writer, String name, Expression expression, org.bson.codecs.EncoderContext encoderContext)
-
Uses of Expression in dev.morphia.aggregation.experimental.expressions
Subclasses of Expression in dev.morphia.aggregation.experimental.expressions Modifier and Type Class Description static class
DateExpressions.DateExpression
Base class for the date expressionsstatic class
ObjectExpressions.MergeObjects
Defines the values to be merged.Fields in dev.morphia.aggregation.experimental.expressions declared as Expression Modifier and Type Field Description static Expression
SystemVariables. CLUSTER_TIME
A variable that returns the current timestamp value.static Expression
SystemVariables. CURRENT
References the start of the field path being processed in the aggregation pipeline stage.static Expression
SystemVariables. DESCEND
One of the allowed results of a $redact expression.static Expression
SystemVariables. KEEP
One of the allowed results of a $redact expression.static Expression
SystemVariables. NOW
A variable that returns the current datetime value.static Expression
SystemVariables. PRUNE
One of the allowed results of a $redact expression.static Expression
SystemVariables. REMOVE
A variable which evaluates to the missing value.static Expression
SystemVariables. ROOT
References the root document, i.e.Methods in dev.morphia.aggregation.experimental.expressions that return Expression Modifier and Type Method Description static Expression
MathExpressions. abs(Expression value)
Returns the absolute value of a number.static Expression
TrigonometryExpressions. acos(Expression value)
Returns the inverse cosine (arc cosine) of a value in radians.static Expression
TrigonometryExpressions. acosh(Expression value)
Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.static Expression
AccumulatorExpressions. addToSet(Expression value)
Returns an array of unique expression values for each group.static Expression
SetExpressions. allElementsTrue(Expression first, Expression... additional)
Returns true if no element of a set evaluates to false, otherwise, returns false.static Expression
BooleanExpressions. and(Expression first, Expression... additional)
Evaluates one or more expressions and returns true if all of the expressions are true or if evoked with no argument expressions.static Expression
SetExpressions. anyElementTrue(Expression first, Expression... additional)
Returns true if any elements of a set evaluate to true; otherwise, returns false.static Expression
ArrayExpressions. arrayToObject(Expression array)
Converts an array of key value pairs to a document.static Expression
TrigonometryExpressions. asin(Expression value)
Returns the inverse sin (arc sine) of a value in radians.static Expression
TrigonometryExpressions. asinh(Expression value)
Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians.static Expression
TrigonometryExpressions. atan(Expression value)
Returns the inverse tangent (arc tangent) of a value in radians.static Expression
TrigonometryExpressions. atan2(Expression yValue, Expression xValue)
Returns the inverse tangent (arc tangent) of y / x in radians, where y and x are the first and second values passed to the expression respectively.static Expression
TrigonometryExpressions. atanh(Expression value)
Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.static Expression
AccumulatorExpressions. avg(Expression value, Expression... additional)
Returns an average of numerical values.static Expression
DataSizeExpressions. binarySize(Expression expression)
Returns the size of a given string or binary data value’s content in bytes.static Expression
DataSizeExpressions. bsonSize(Expression expression)
Returns the size in bytes of a given document (i.e.static Expression
MathExpressions. ceil(Expression value)
Returns the smallest integer greater than or equal to the specified number.static Expression
ComparisonExpressions. cmp(Expression first, Expression second)
Returns 0 if the two values are equivalent, 1 if the first value is greater than the second, and -1 if the first value is less than the second.static Expression
StringExpressions. concat(Expression first, Expression... additional)
Concatenates any number of strings.static Expression
ArrayExpressions. concatArrays(Expression array, Expression additional)
Concatenates arrays to return the concatenated array.static Expression
ConditionalExpressions. condition(Expression condition, Expression then, Expression otherwise)
Evaluates a boolean expression to return one of the two specified return expressions.static Expression
TypeExpressions. convert(Expression input, ConvertType to)
Converts a value to a specified type.static Expression
TrigonometryExpressions. cos(Expression value)
Returns the cosine of a value that is measured in radians.static Expression
TrigonometryExpressions. degreesToRadians(Expression value)
Converts a value from degrees to radians.static Expression
MathExpressions. divide(Expression numerator, Expression divisor)
Returns the result of dividing the first number by the second.static Expression
ArrayExpressions. elementAt(Expression array, Expression index)
Returns the element at the specified array index.static Expression
ComparisonExpressions. eq(Expression first, Expression second)
Returns true if the values are equivalent.static Expression
MathExpressions. exp(Expression value)
Raises e to the specified exponent.static Expression
Expressions. field(String name)
Creates a field expression for the given value.static Expression
AccumulatorExpressions. first(Expression value)
Returns a value from the first document for each group.static Expression
MathExpressions. floor(Expression value)
Returns the largest integer less than or equal to the specified number.static Expression
AccumulatorExpressions. function(String body, Expression... args)
Defines a custom aggregation function or expression in JavaScript.static Expression
ComparisonExpressions. gt(Expression first, Expression second)
Compares two values and returns: true when the first value is greater than the second value.static Expression
ComparisonExpressions. gte(Expression first, Expression second)
Compares two values and returns: true when the first value is greater than or equivalent to the second value.static Expression
ArrayExpressions. in(Expression search, Expression array)
Returns a boolean indicating whether a specified value is in an array.static Expression
ArrayExpressions. indexOfArray(Expression array, Expression search)
Searches an array for an occurrence of a specified value and returns the array index of the first occurernce.static Expression
ArrayExpressions. isArray(Expression array)
Determines if the operand is an array.static Expression
TypeExpressions. isNumber(Expression input)
Checks if the specified expression resolves to one of the numeric BSON types.static Expression
AccumulatorExpressions. last(Expression value)
Returns a value from the last document for each group.static Expression
Expressions. literal(Object value)
Returns a value without parsing.static Expression
MathExpressions. ln(Expression value)
Calculates the natural log of a number.static Expression
MathExpressions. log(Expression number, Expression base)
Calculates the log of a number in the specified base.static Expression
MathExpressions. log10(Expression value)
Calculates the log base 10 of a number.static Expression
ComparisonExpressions. lt(Expression first, Expression second)
Returns true if the first value is less than the second.static Expression
ComparisonExpressions. lte(Expression first, Expression second)
Compares two values and returns: true when the first value is less than or equivalent to the second value.static Expression
AccumulatorExpressions. max(Expression value)
Returns the highest expression value for each group.static Expression
Expressions. meta()
Returns the metadata associated with a document in a pipeline operations, e.g.static Expression
AccumulatorExpressions. min(Expression value)
Returns the lowest expression value for each group.static Expression
MathExpressions. mod(Expression dividend, Expression divisor)
Returns the remainder of the first number divided by the second.static Expression
MathExpressions. multiply(Expression first, Expression... additional)
Multiplies numbers together and returns the result.static Expression
ComparisonExpressions. ne(Expression first, Expression second)
Returns true if the values are not equivalent.static Expression
BooleanExpressions. not(Expression value)
Evaluates a boolean and returns the opposite boolean value; i.e.static Expression
ArrayExpressions. objectToArray(Expression array)
Converts a document to an array of documents representing key-value pairs.static Expression
BooleanExpressions. or(Expression first, Expression... additional)
Evaluates one or more expressions and returns true if any of the expressions are true.static Expression
MathExpressions. pow(Expression number, Expression exponent)
Raises a number to the specified exponent.static Expression
AccumulatorExpressions. push(Expression value)
Returns an array of expression values for each group.static Expression
TrigonometryExpressions. radiansToDegrees(Expression value)
Converts a value from radians to degrees.static Expression
ArrayExpressions. reduce(Expression input, Expression initial, Expression in)
Applies an expression to each element in an array and combines them into a single value.static Expression
StringExpressions. replaceAll(Expression input, Expression find, Expression replacement)
Replaces all instances of a search string in an input string with a replacement string.static Expression
StringExpressions. replaceOne(Expression input, Expression find, Expression replacement)
Replaces the first instance of a search string in an input string with a replacement string.static Expression
ArrayExpressions. reverseArray(Expression array)
Returns an array with the elements in reverse order.static Expression
MathExpressions. round(Expression number, Expression place)
Rounds a number to to a whole integer or to a specified decimal place.static Expression
SetExpressions. setDifference(Expression first, Expression second)
Returns a set with elements that appear in the first set but not in the second set; i.e.static Expression
SetExpressions. setEquals(Expression first, Expression... additional)
Returns true if the input sets have the same distinct elements.static Expression
SetExpressions. setIntersection(Expression first, Expression... additional)
Returns a set with elements that appear in all of the input sets.static Expression
SetExpressions. setIsSubset(Expression first, Expression second)
Returns true if all elements of the first set appear in the second set, including when the first set equals the second set; i.e.static Expression
SetExpressions. setUnion(Expression first, Expression... additional)
Returns a set with elements that appear in any of the input sets.static Expression
TrigonometryExpressions. sin(Expression value)
Returns the sine of a value that is measured in radians.static Expression
ArrayExpressions. size(Expression array)
Counts and returns the total number of items in an array.static Expression
ArrayExpressions. slice(Expression array, int size)
Returns a subset of an array.static Expression
StringExpressions. split(Expression input, Expression delimiter)
Splits a string into substrings based on a delimiter.static Expression
MathExpressions. sqrt(Expression value)
Calculates the square root.static Expression
AccumulatorExpressions. stdDevPop(Expression value, Expression... additional)
Returns the population standard deviation of the input values.static Expression
AccumulatorExpressions. stdDevSamp(Expression value, Expression... additional)
Returns the sample standard deviation of the input values.static Expression
StringExpressions. strcasecmp(Expression first, Expression second)
Performs case-insensitive string comparison and returns: 0 if two strings are equivalent, 1 if the first string is greater than the second, and -1 if the first string is less than the second.static Expression
StringExpressions. strLenBytes(Expression input)
Returns the number of UTF-8 encoded bytes in a string.static Expression
StringExpressions. strLenCP(Expression input)
Returns the number of UTF-8 code points in a string.static Expression
StringExpressions. substr(Expression input, int start, int length)
Deprecated.Deprecated since version 3.4: $substr is now an alias forStringExpressions.substrBytes(Expression, int, int)
static Expression
StringExpressions. substrBytes(Expression input, int start, int length)
Returns the substring of a string.static Expression
StringExpressions. substrCP(Expression input, int start, int length)
Returns the substring of a string.static Expression
MathExpressions. subtract(Expression minuend, Expression subtrahend)
Returns the result of subtracting the second value from the first.static Expression
AccumulatorExpressions. sum(Expression first, Expression... additional)
Calculates and returns the sum of numeric values.static Expression
TrigonometryExpressions. tan(Expression value)
Returns the tangent of a value that is measured in radians.static Expression
TypeExpressions. toBool(Expression input)
Converts value to a boolean.static Expression
TypeExpressions. toDate(Expression input)
Converts value to a Date.static Expression
TypeExpressions. toDecimal(Expression input)
Converts value to a Decimal128.static Expression
TypeExpressions. toDouble(Expression input)
Converts value to a double.static Expression
TypeExpressions. toInt(Expression input)
Converts value to an integer.static Expression
TypeExpressions. toLong(Expression input)
Converts value to a long.static Expression
StringExpressions. toLower(Expression input)
Converts a string to lowercase.static Expression
TypeExpressions. toObjectId(Expression input)
Converts value to an ObjectId.static Expression
StringExpressions. toString(Expression input)
Converts value to a string.static Expression
TypeExpressions. toString(Expression input)
Converts value to a string.static Expression
StringExpressions. toUpper(Expression input)
Converts a string to uppercase.static Expression
MathExpressions. trunc(Expression number, Expression place)
Truncates a number to a whole integer or to a specified decimal place.static Expression
TypeExpressions. type(Expression input)
Return the BSON data type of the field.static Expression
Expressions. value(Object value)
Returns a value without parsing.Methods in dev.morphia.aggregation.experimental.expressions with parameters of type Expression Modifier and Type Method Description static Expression
MathExpressions. abs(Expression value)
Returns the absolute value of a number.static Expression
TrigonometryExpressions. acos(Expression value)
Returns the inverse cosine (arc cosine) of a value in radians.static Expression
TrigonometryExpressions. acosh(Expression value)
Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.static MathExpression
MathExpressions. add(Expression first, Expression... additional)
Adds numbers together or adds numbers and a date.ObjectExpressions.MergeObjects
ObjectExpressions.MergeObjects. add(Expression expression)
Adds an expression to be mergedstatic Expression
AccumulatorExpressions. addToSet(Expression value)
Returns an array of unique expression values for each group.static Expression
SetExpressions. allElementsTrue(Expression first, Expression... additional)
Returns true if no element of a set evaluates to false, otherwise, returns false.static Expression
BooleanExpressions. and(Expression first, Expression... additional)
Evaluates one or more expressions and returns true if all of the expressions are true or if evoked with no argument expressions.static Expression
SetExpressions. anyElementTrue(Expression first, Expression... additional)
Returns true if any elements of a set evaluate to true; otherwise, returns false.static ArrayExpression
ArrayExpressions. array(Expression... expressions)
Creates an array of the given expressions.static Expression
ArrayExpressions. arrayToObject(Expression array)
Converts an array of key value pairs to a document.static Expression
TrigonometryExpressions. asin(Expression value)
Returns the inverse sin (arc sine) of a value in radians.static Expression
TrigonometryExpressions. asinh(Expression value)
Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians.static Expression
TrigonometryExpressions. atan(Expression value)
Returns the inverse tangent (arc tangent) of a value in radians.static Expression
TrigonometryExpressions. atan2(Expression yValue, Expression xValue)
Returns the inverse tangent (arc tangent) of y / x in radians, where y and x are the first and second values passed to the expression respectively.static Expression
TrigonometryExpressions. atanh(Expression value)
Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.static Expression
AccumulatorExpressions. avg(Expression value, Expression... additional)
Returns an average of numerical values.static Expression
DataSizeExpressions. binarySize(Expression expression)
Returns the size of a given string or binary data value’s content in bytes.static Expression
DataSizeExpressions. bsonSize(Expression expression)
Returns the size in bytes of a given document (i.e.static Expression
MathExpressions. ceil(Expression value)
Returns the smallest integer greater than or equal to the specified number.static Expression
ComparisonExpressions. cmp(Expression first, Expression second)
Returns 0 if the two values are equivalent, 1 if the first value is greater than the second, and -1 if the first value is less than the second.static Expression
StringExpressions. concat(Expression first, Expression... additional)
Concatenates any number of strings.static Expression
ArrayExpressions. concatArrays(Expression array, Expression additional)
Concatenates arrays to return the concatenated array.static Expression
ConditionalExpressions. condition(Expression condition, Expression then, Expression otherwise)
Evaluates a boolean expression to return one of the two specified return expressions.static Expression
TypeExpressions. convert(Expression input, ConvertType to)
Converts a value to a specified type.static Expression
TrigonometryExpressions. cos(Expression value)
Returns the cosine of a value that is measured in radians.static DateToParts
DateExpressions. dateToParts(Expression date)
Constructs and returns a Date object given the date’s constituent properties.static DateExpressions.DateExpression
DateExpressions. dayOfMonth(Expression value)
Returns the day of the month for a date as a number between 1 and 31.static DateExpressions.DateExpression
DateExpressions. dayOfWeek(Expression value)
Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday).static DateExpressions.DateExpression
DateExpressions. dayOfYear(Expression value)
Returns the day of the year for a date as a number between 1 and 366 (leap year).static Expression
TrigonometryExpressions. degreesToRadians(Expression value)
Converts a value from degrees to radians.static Expression
MathExpressions. divide(Expression numerator, Expression divisor)
Returns the result of dividing the first number by the second.static Expression
ArrayExpressions. elementAt(Expression array, Expression index)
Returns the element at the specified array index.static Expression
ComparisonExpressions. eq(Expression first, Expression second)
Returns true if the values are equivalent.static Expression
MathExpressions. exp(Expression value)
Raises e to the specified exponent.static ArrayFilterExpression
ArrayExpressions. filter(Expression array, Expression conditional)
Selects a subset of the array to return an array with only the elements that match the filter condition.static Expression
AccumulatorExpressions. first(Expression value)
Returns a value from the first document for each group.static Expression
MathExpressions. floor(Expression value)
Returns the largest integer less than or equal to the specified number.static Expression
AccumulatorExpressions. function(String body, Expression... args)
Defines a custom aggregation function or expression in JavaScript.static Expression
ComparisonExpressions. gt(Expression first, Expression second)
Compares two values and returns: true when the first value is greater than the second value.static Expression
ComparisonExpressions. gte(Expression first, Expression second)
Compares two values and returns: true when the first value is greater than or equivalent to the second value.static DateExpressions.DateExpression
DateExpressions. hour(Expression value)
Returns the hour for a date as a number between 0 and 23.static Expression
ArrayExpressions. in(Expression search, Expression array)
Returns a boolean indicating whether a specified value is in an array.static Expression
ArrayExpressions. indexOfArray(Expression array, Expression search)
Searches an array for an occurrence of a specified value and returns the array index of the first occurernce.static IndexExpression
StringExpressions. indexOfBytes(Expression string, Expression substring)
Searches a string for an occurence of a substring and returns the UTF-8 byte index of the first occurence.static IndexExpression
StringExpressions. indexOfCP(Expression string, Expression substring)
Searches a string for an occurence of a substring and returns the UTF-8 code point index of the first occurence.static Expression
ArrayExpressions. isArray(Expression array)
Determines if the operand is an array.static Expression
TypeExpressions. isNumber(Expression input)
Checks if the specified expression resolves to one of the numeric BSON types.static IsoDates
DateExpressions. isoDayOfWeek(Expression value)
Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday).static IsoDates
DateExpressions. isoWeek(Expression value)
Returns the week number in ISO 8601 format, ranging from 1 to 53.static IsoDates
DateExpressions. isoWeekYear(Expression value)
Returns the year number in ISO 8601 format.static Expression
AccumulatorExpressions. last(Expression value)
Returns a value from the last document for each group.static LetExpression
VariableExpressions. let(Expression in)
Binds variables for use in the specified expression, and returns the result of the expression.static Expression
MathExpressions. ln(Expression value)
Calculates the natural log of a number.static Expression
MathExpressions. log(Expression number, Expression base)
Calculates the log of a number in the specified base.static Expression
MathExpressions. log10(Expression value)
Calculates the log base 10 of a number.static Expression
ComparisonExpressions. lt(Expression first, Expression second)
Returns true if the first value is less than the second.static Expression
ComparisonExpressions. lte(Expression first, Expression second)
Compares two values and returns: true when the first value is less than or equivalent to the second value.static TrimExpression
StringExpressions. ltrim(Expression input)
Removes whitespace or the specified characters from the beginning of a string.static MapExpression
ArrayExpressions. map(Expression input, Expression in)
Applies a subexpression to each element of an array and returns the array of resulting values in order.static Expression
AccumulatorExpressions. max(Expression value)
Returns the highest expression value for each group.static DateExpressions.DateExpression
DateExpressions. milliseconds(Expression value)
Returns the milliseconds of a date as a number between 0 and 999.static Expression
AccumulatorExpressions. min(Expression value)
Returns the lowest expression value for each group.static DateExpressions.DateExpression
DateExpressions. minute(Expression value)
Returns the minute for a date as a number between 0 and 59.static Expression
MathExpressions. mod(Expression dividend, Expression divisor)
Returns the remainder of the first number divided by the second.static DateExpressions.DateExpression
DateExpressions. month(Expression value)
Returns the month for a date as a number between 1 (January) and 12 (December).static Expression
MathExpressions. multiply(Expression first, Expression... additional)
Multiplies numbers together and returns the result.static Expression
ComparisonExpressions. ne(Expression first, Expression second)
Returns true if the values are not equivalent.static Expression
BooleanExpressions. not(Expression value)
Evaluates a boolean and returns the opposite boolean value; i.e.static Expression
ArrayExpressions. objectToArray(Expression array)
Converts a document to an array of documents representing key-value pairs.static Expression
BooleanExpressions. or(Expression first, Expression... additional)
Evaluates one or more expressions and returns true if any of the expressions are true.static Expression
MathExpressions. pow(Expression number, Expression exponent)
Raises a number to the specified exponent.static Expression
AccumulatorExpressions. push(Expression value)
Returns an array of expression values for each group.static Expression
TrigonometryExpressions. radiansToDegrees(Expression value)
Converts a value from radians to degrees.static Expression
ArrayExpressions. reduce(Expression input, Expression initial, Expression in)
Applies an expression to each element in an array and combines them into a single value.static RegexExpression
StringExpressions. regexFind(Expression input)
Applies a regular expression (regex) to a string and returns information on the first matched substring.static RegexExpression
StringExpressions. regexFindAll(Expression input)
Applies a regular expression (regex) to a string and returns information on the all matched substrings.static RegexExpression
StringExpressions. regexMatch(Expression input)
Applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not.static Expression
StringExpressions. replaceAll(Expression input, Expression find, Expression replacement)
Replaces all instances of a search string in an input string with a replacement string.static Expression
StringExpressions. replaceOne(Expression input, Expression find, Expression replacement)
Replaces the first instance of a search string in an input string with a replacement string.static Expression
ArrayExpressions. reverseArray(Expression array)
Returns an array with the elements in reverse order.static Expression
MathExpressions. round(Expression number, Expression place)
Rounds a number to to a whole integer or to a specified decimal place.static TrimExpression
StringExpressions. rtrim(Expression input)
Removes whitespace or the specified characters from the end of a string.static DateExpressions.DateExpression
DateExpressions. second(Expression value)
Returns the seconds for a date as a number between 0 and 60 (leap seconds).static Expression
SetExpressions. setDifference(Expression first, Expression second)
Returns a set with elements that appear in the first set but not in the second set; i.e.static Expression
SetExpressions. setEquals(Expression first, Expression... additional)
Returns true if the input sets have the same distinct elements.static Expression
SetExpressions. setIntersection(Expression first, Expression... additional)
Returns a set with elements that appear in all of the input sets.static Expression
SetExpressions. setIsSubset(Expression first, Expression second)
Returns true if all elements of the first set appear in the second set, including when the first set equals the second set; i.e.static Expression
SetExpressions. setUnion(Expression first, Expression... additional)
Returns a set with elements that appear in any of the input sets.static Expression
TrigonometryExpressions. sin(Expression value)
Returns the sine of a value that is measured in radians.static Expression
ArrayExpressions. size(Expression array)
Counts and returns the total number of items in an array.static Expression
ArrayExpressions. slice(Expression array, int size)
Returns a subset of an array.static Expression
StringExpressions. split(Expression input, Expression delimiter)
Splits a string into substrings based on a delimiter.static Expression
MathExpressions. sqrt(Expression value)
Calculates the square root.static Expression
AccumulatorExpressions. stdDevPop(Expression value, Expression... additional)
Returns the population standard deviation of the input values.static Expression
AccumulatorExpressions. stdDevSamp(Expression value, Expression... additional)
Returns the sample standard deviation of the input values.static Expression
StringExpressions. strcasecmp(Expression first, Expression second)
Performs case-insensitive string comparison and returns: 0 if two strings are equivalent, 1 if the first string is greater than the second, and -1 if the first string is less than the second.static Expression
StringExpressions. strLenBytes(Expression input)
Returns the number of UTF-8 encoded bytes in a string.static Expression
StringExpressions. strLenCP(Expression input)
Returns the number of UTF-8 code points in a string.static Expression
StringExpressions. substr(Expression input, int start, int length)
Deprecated.Deprecated since version 3.4: $substr is now an alias forStringExpressions.substrBytes(Expression, int, int)
static Expression
StringExpressions. substrBytes(Expression input, int start, int length)
Returns the substring of a string.static Expression
StringExpressions. substrCP(Expression input, int start, int length)
Returns the substring of a string.static Expression
MathExpressions. subtract(Expression minuend, Expression subtrahend)
Returns the result of subtracting the second value from the first.static Expression
AccumulatorExpressions. sum(Expression first, Expression... additional)
Calculates and returns the sum of numeric values.static Expression
TrigonometryExpressions. tan(Expression value)
Returns the tangent of a value that is measured in radians.static Expression
TypeExpressions. toBool(Expression input)
Converts value to a boolean.static DateExpressions.DateExpression
DateExpressions. toDate(Expression value)
Converts a value to a date.static Expression
TypeExpressions. toDate(Expression input)
Converts value to a Date.static Expression
TypeExpressions. toDecimal(Expression input)
Converts value to a Decimal128.static Expression
TypeExpressions. toDouble(Expression input)
Converts value to a double.static Expression
TypeExpressions. toInt(Expression input)
Converts value to an integer.static Expression
TypeExpressions. toLong(Expression input)
Converts value to a long.static Expression
StringExpressions. toLower(Expression input)
Converts a string to lowercase.static Expression
TypeExpressions. toObjectId(Expression input)
Converts value to an ObjectId.static Expression
StringExpressions. toString(Expression input)
Converts value to a string.static Expression
TypeExpressions. toString(Expression input)
Converts value to a string.static Expression
StringExpressions. toUpper(Expression input)
Converts a string to uppercase.static TrimExpression
StringExpressions. trim(Expression input)
Removes whitespace or the specified characters from the beginning and end of a string.static Expression
MathExpressions. trunc(Expression number, Expression place)
Truncates a number to a whole integer or to a specified decimal place.static Expression
TypeExpressions. type(Expression input)
Return the BSON data type of the field.static DateExpressions.DateExpression
DateExpressions. week(Expression value)
Returns the week number for a date as a number between 0 (the partial week that precedes the first Sunday of the year) and 53 (leap year).static DateExpressions.DateExpression
DateExpressions. year(Expression value)
Returns the year for a date as a number (e.g.static ZipExpression
ArrayExpressions. zip(Expression... arrays)
Merge two arrays together.Method parameters in dev.morphia.aggregation.experimental.expressions with type arguments of type Expression Modifier and Type Method Description static AccumulatorExpression
AccumulatorExpressions. accumulator(String initFunction, String accumulateFunction, List<Expression> accumulateArgs, String mergeFunction)
Returns an array of unique expression values for each group.Constructors in dev.morphia.aggregation.experimental.expressions with parameters of type Expression Constructor Description DateExpression(String operation, Expression value)
-
Uses of Expression in dev.morphia.aggregation.experimental.expressions.impls
Subclasses of Expression in dev.morphia.aggregation.experimental.expressions.impls Modifier and Type Class Description class
Accumulator
Base class for the accumulator expression types.class
AccumulatorExpression
class
ArrayExpression
Base class for the array expressionsclass
ArrayFilterExpression
class
ArrayIndexExpression
class
ArrayLiteral
class
ConvertExpression
class
DateFromParts
class
DateFromString
class
DateToParts
Returns a document that contains the constituent parts of a given BSON Date value as individual properties.class
DateToString
class
DocumentExpression
class
FunctionExpression
class
IfNull
class
IndexExpression
Defines the $indexOfBytes expressionclass
IsoDates
Reusable type for ISO Date related expressions.class
LetExpression
class
LiteralExpression
class
MapExpression
class
MathExpression
Base class for the math expressionsclass
MetaExpression
class
Push
class
RangeExpression
class
ReduceExpression
class
RegexExpression
class
ReplaceExpression
Defines expressions for $replaceAll and $replaceOneclass
SliceExpression
class
SwitchExpression
Evaluates a series of case expressions.class
TrimExpression
class
ValueExpression
class
ZipExpression
Methods in dev.morphia.aggregation.experimental.expressions.impls that return Expression Modifier and Type Method Description Expression
IfNull. getReplacement()
Expression
IfNull. getTarget()
Expression
PipelineField. getValue()
Methods in dev.morphia.aggregation.experimental.expressions.impls with parameters of type Expression Modifier and Type Method Description T
Fields. add(String name, Expression expression)
SwitchExpression
SwitchExpression. branch(Expression caseExpression, Expression then)
Adds a new branch to the switchTrimExpression
TrimExpression. chars(Expression chars)
DateToString
DateToString. date(Expression date)
DateFromString
DateFromString. dateString(Expression dateString)
DateFromParts
DateFromParts. day(Expression value)
Day of month.SwitchExpression
SwitchExpression. defaultCase(Expression caseExpression)
Adds a default case if nothing is matched.ZipExpression
ZipExpression. defaults(Expression defaults)
An array of default element values to use if the input arrays have different lengths.DocumentExpression
DocumentExpression. field(String name, Expression expression)
T
FieldHolder. field(String name, Expression expression)
IfNull
IfNull. field(String name, Expression expression)
Push
Push. field(String name, Expression expression)
DateFromString
DateFromString. format(Expression format)
DateToString
DateToString. format(Expression format)
DateFromParts
DateFromParts. hour(Expression value)
Can be any expression that evaluates to a number.DateFromParts
DateFromParts. isoDayOfWeek(Expression value)
Day of week (Monday 1 - Sunday 7).DateFromParts
DateFromParts. isoWeek(Expression value)
Week of year.DateFromParts
DateFromParts. isoWeekYear(Expression value)
ISO Week Date Year.DateFromParts
DateFromParts. millisecond(Expression value)
Can be any expression that evaluates to a number.DateFromParts
DateFromParts. minute(Expression value)
Can be any expression that evaluates to a number.DateFromParts
DateFromParts. month(Expression value)
Can be any expression that evaluates to a number.ConvertExpression
ConvertExpression. onError(Expression onError)
The value to return on encountering an error during conversion, including unsupported type conversions.DateFromString
DateFromString. onError(Expression onError)
ConvertExpression
ConvertExpression. onNull(Expression onNull)
The value to return if the input is null or missing.DateFromString
DateFromString. onNull(Expression onNull)
DateToString
DateToString. onNull(Expression onNull)
IfNull
IfNull. replacement(Expression replacement)
DateFromParts
DateFromParts. second(Expression value)
Can be any expression that evaluates to a number.Push
Push. single(Expression source)
IfNull
IfNull. target(Expression target)
DateFromParts
DateFromParts. timezone(Expression value)
Can be any expression that evaluates to a string whose value is either: an Olson Timezone Identifier, such as "Europe/London" or "America/New_York", or a UTC offset in the form: +/-[hh]:[mm], e.g.DateToParts
DateToParts. timezone(Expression timezone)
The optional timezone to use to format the date.IsoDates
IsoDates. timezone(Expression timezone)
The optional timezone to use to format the date.DateFromString
DateFromString. timeZone(Expression timeZone)
DateToString
DateToString. timeZone(Expression timeZone)
LetExpression
LetExpression. variable(String name, Expression expression)
Defines a new variableDateFromParts
DateFromParts. year(Expression value)
Calendar year.Method parameters in dev.morphia.aggregation.experimental.expressions.impls with type arguments of type Expression Modifier and Type Method Description AccumulatorExpression
AccumulatorExpression. initArgs(List<Expression> initArgs)
Optional.Constructor parameters in dev.morphia.aggregation.experimental.expressions.impls with type arguments of type Expression Constructor Description Accumulator(String operation, List<Expression> values)
AccumulatorExpression(String initFunction, String accumulateFunction, List<Expression> accumulateArgs, String mergeFunction)
FunctionExpression(String body, List<Expression> args)
Creates the new expressionMathExpression(String operation, List<Expression> operands)
ZipExpression(List<Expression> inputs)
-
Uses of Expression in dev.morphia.aggregation.experimental.stages
Methods in dev.morphia.aggregation.experimental.stages that return Expression Modifier and Type Method Description Expression
Redact. getExpression()
Expression
SortByCount. getExpression()
Expression
Group.GroupId. getField()
Expression
AutoBucket. getGroupBy()
Expression
Bucket. getGroupBy()
Expression
Unwind. getPath()
Expression
GraphLookup. getStartWith()
Expression
ReplaceRoot. getValue()
Expression
ReplaceWith. getValue()
Methods in dev.morphia.aggregation.experimental.stages that return types with arguments of type Expression Modifier and Type Method Description List<Expression>
Bucket. getBoundaries()
List<Expression>
Unset. getFields()
Map<String,Expression>
Merge. getVariables()
Methods in dev.morphia.aggregation.experimental.stages with parameters of type Expression Modifier and Type Method Description Bucket
Bucket. boundaries(Expression... boundaries)
An array of values based on the groupBy expression that specify the boundaries for each bucket.AddFields
AddFields. field(String name, Expression value)
Add a field to the stageGroup
Group. field(String name, Expression expression)
Adds a named field to the group with an expression giving the value.Group.GroupId
Group.GroupId. field(String name, Expression expression)
Adds a named field to the group with an expression giving the value.ReplaceRoot
ReplaceRoot. field(String name, Expression expression)
Adds a new fieldReplaceWith
ReplaceWith. field(String name, Expression expression)
Adds a new fieldAutoBucket
AutoBucket. groupBy(Expression groupBy)
An expression to group documents by.Bucket
Bucket. groupBy(Expression groupBy)
An expression to group documents by.static Group.GroupId
Group. id(Expression name)
Creates a named group IDProjection
Projection. include(String name, Expression value)
Includes a field.Lookup
Lookup. let(String name, Expression expression)
Defines a variableMerge<M>
Merge. let(String variable, Expression value)
Specifies a variable accessible for use in the whenMatched pipelinestatic Redact
Redact. on(Expression expression)
Creates a redaction stage with the given expressionstatic SortByCount
SortByCount. on(Expression expression)
Creates a new stage grouping by the given expression.AutoBucket
AutoBucket. outputField(String name, Expression value)
Adds a field to the document that specifies the fields to include in the output documents in addition to the _id field.Bucket
Bucket. outputField(String name, Expression value)
Adds a field to the document that specifies the fields to include in the output documents in addition to the _id field.GraphLookup
GraphLookup. startWith(Expression startWith)
Expression that specifies the value of the connectFromField with which to start the recursive search.static ReplaceRoot
ReplaceRoot. with(Expression expression)
Creates a new stage to replace the root with the given expression.static ReplaceWith
ReplaceWith. with(Expression expression)
Creates a new stage to replace the root with the given expression.Constructors in dev.morphia.aggregation.experimental.stages with parameters of type Expression Constructor Description GroupId(Expression value)
ReplaceRoot(Expression expression)
ReplaceWith(Expression expression)
SortByCount(Expression expression)
-
Uses of Expression in dev.morphia.query.experimental.filters
Methods in dev.morphia.query.experimental.filters with parameters of type Expression Modifier and Type Method Description static Filter
Filters. expr(Expression expression)
Allows use of aggregation expressions within the query language.
-