Uses of Class
dev.morphia.aggregation.expressions.impls.Expression
-
Packages that use Expression Package Description dev.morphia.aggregation dev.morphia.aggregation.expressions dev.morphia.aggregation.expressions.impls dev.morphia.aggregation.stages dev.morphia.query.filters -
-
Uses of Expression in dev.morphia.aggregation
Methods in dev.morphia.aggregation 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.expressions
Subclasses of Expression in dev.morphia.aggregation.expressions Modifier and Type Class Description static classBooleanExpressions.LogicalExpressionDefines a logical expression.static classDateExpressions.DateExpressionBase class for the date expressionsstatic classObjectExpressions.MergeObjectsDefines the values to be merged.Fields in dev.morphia.aggregation.expressions declared as Expression Modifier and Type Field Description static ExpressionSystemVariables. CLUSTER_TIMEA variable that returns the current timestamp value.static ExpressionSystemVariables. CURRENTReferences the start of the field path being processed in the aggregation pipeline stage.static ExpressionSystemVariables. DESCENDOne of the allowed results of a $redact expression.static ExpressionSystemVariables. KEEPOne of the allowed results of a $redact expression.static ExpressionSystemVariables. NOWA variable that returns the current datetime value.static ExpressionSystemVariables. PRUNEOne of the allowed results of a $redact expression.static ExpressionSystemVariables. REMOVEA variable which evaluates to the missing value.static ExpressionSystemVariables. ROOTReferences the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage.Methods in dev.morphia.aggregation.expressions that return Expression Modifier and Type Method Description static ExpressionMathExpressions. abs(Expression value)Returns the absolute value of a number.static ExpressionTrigonometryExpressions. acos(Expression value)Returns the inverse cosine (arc cosine) of a value in radians.static ExpressionTrigonometryExpressions. acosh(Expression value)Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.static ExpressionAccumulatorExpressions. addToSet(Expression value)Returns an array of unique expression values for each group.static ExpressionSetExpressions. allElementsTrue(Expression first, Expression... additional)Returns true if no element of a set evaluates to false, otherwise, returns false.static ExpressionSetExpressions. anyElementTrue(Expression first, Expression... additional)Returns true if any elements of a set evaluate to true; otherwise, returns false.static ExpressionArrayExpressions. arrayToObject(Expression array)Converts an array of key value pairs to a document.static ExpressionTrigonometryExpressions. asin(Expression value)Returns the inverse sin (arc sine) of a value in radians.static ExpressionTrigonometryExpressions. asinh(Expression value)Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians.static ExpressionTrigonometryExpressions. atan(Expression value)Returns the inverse tangent (arc tangent) of a value in radians.static ExpressionTrigonometryExpressions. 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 ExpressionTrigonometryExpressions. atanh(Expression value)Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.static ExpressionAccumulatorExpressions. avg(Expression value, Expression... additional)Returns an average of numerical values.static ExpressionDataSizeExpressions. binarySize(Expression expression)Returns the size of a given string or binary data value’s content in bytes.static ExpressionAccumulatorExpressions. bottom(Expression output, Sort... sortBy)Returns the bottom element within a group according to the specified sort order.static ExpressionAccumulatorExpressions. bottomN(Expression n, Expression output, Sort... sortBy)Returns an aggregation of the bottom n elements within a group, according to the specified sort order.static ExpressionDataSizeExpressions. bsonSize(Expression expression)Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON.static ExpressionMathExpressions. ceil(Expression value)Returns the smallest integer greater than or equal to the specified number.static ExpressionComparisonExpressions. 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 ExpressionStringExpressions. concat(Expression first, Expression... additional)Concatenates any number of strings.static ExpressionArrayExpressions. concatArrays(Expression array, Expression additional)Concatenates arrays to return the concatenated array.static ExpressionConditionalExpressions. condition(Expression condition, Expression then, Expression otherwise)Evaluates a boolean expression to return one of the two specified return expressions.static ExpressionTypeExpressions. convert(Expression input, ConvertType to)Converts a value to a specified type.static ExpressionTrigonometryExpressions. cos(Expression value)Returns the cosine of a value that is measured in radians.static ExpressionTrigonometryExpressions. cosh(Expression value)Returns the hyperbolic cosine of a value that is measured in radians.static ExpressionWindowExpressions. covariancePop(Expression first, Expression second)Returns the population covariance of two numeric expressions that are evaluated using documents in the $setWindowFields stage window.static ExpressionWindowExpressions. covarianceSamp(Expression first, Expression second)Returns the sample covariance of two numeric expressions that are evaluated using documents in the $setWindowFields stage window.static ExpressionTrigonometryExpressions. degreesToRadians(Expression value)Converts a value from degrees to radians.static ExpressionWindowExpressions. denseRank()Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition.static ExpressionMathExpressions. divide(Expression numerator, Expression divisor)Returns the result of dividing the first number by the second.static ExpressionWindowExpressions. documentNumber()Returns the position of a document (known as the document number) in the $setWindowFields stage partition.static ExpressionArrayExpressions. elementAt(Expression array, Expression index)Returns the element at the specified array index.static ExpressionComparisonExpressions. eq(Expression first, Expression second)Returns true if the values are equivalent.static ExpressionMathExpressions. exp(Expression value)Raises e to the specified exponent.static ExpressionWindowExpressions. expMovingAvg(Expression input, int n)Returns the exponential moving average of numeric expressions applied to documents in a partition defined in the $setWindowFields stage.static ExpressionExpressions. field(String name)Creates a field expression for the given value.static ExpressionAccumulatorExpressions. first(Expression value)Returns a value from the first document for each group.static ExpressionAccumulatorExpressions. firstN(Expression n, Expression input)Returns an aggregation of the first n elements within a group.static ExpressionMathExpressions. floor(Expression value)Returns the largest integer less than or equal to the specified number.static ExpressionAccumulatorExpressions. function(String body, Expression... args)Defines a custom aggregation function or expression in JavaScript.static ExpressionMiscellaneous. getField(Expression field)Returns the value of a specified field from a document.static ExpressionMiscellaneous. getField(String field)Returns the value of a specified field from a document.static ExpressionComparisonExpressions. gt(Expression first, Expression second)Compares two values and returns: true when the first value is greater than the second value.static ExpressionComparisonExpressions. 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 ExpressionArrayExpressions. in(Expression search, Expression array)Returns a boolean indicating whether a specified value is in an array.static ExpressionArrayExpressions. 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 ExpressionArrayExpressions. isArray(Expression array)Determines if the operand is an array.static ExpressionTypeExpressions. isNumber(Expression input)Checks if the specified expression resolves to one of the numeric BSON types.static ExpressionAccumulatorExpressions. last(Expression value)Returns a value from the last document for each group.static ExpressionAccumulatorExpressions. lastN(Expression n, Expression input)Returns an aggregation of the last n elements within a group.static ExpressionWindowExpressions. linearFill(Expression fillValue)Fills null and missing fields in a window using linear interpolation based on surrounding field values.static ExpressionExpressions. literal(Object value)Returns a value without parsing.static ExpressionMathExpressions. ln(Expression value)Calculates the natural log of a number.static ExpressionWindowExpressions. locf(Expression fillValue)Last observation carried forward.static ExpressionMathExpressions. log(Expression number, Expression base)Calculates the log of a number in the specified base.static ExpressionMathExpressions. log10(Expression value)Calculates the log base 10 of a number.static ExpressionComparisonExpressions. lt(Expression first, Expression second)Returns true if the first value is less than the second.static ExpressionComparisonExpressions. 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 ExpressionAccumulatorExpressions. max(Expression value)Returns the highest expression value for each group.static ExpressionAccumulatorExpressions. maxN(Expression n, Expression input)Returns an aggregation of the max n elements within a group.static ExpressionExpressions. meta()Returns the metadata associated with a document in a pipeline operations, e.g.static ExpressionAccumulatorExpressions. min(Expression value)Returns the lowest expression value for each group.static ExpressionAccumulatorExpressions. minN(Expression n, Expression input)Returns an aggregation of the min n elements within a group.static ExpressionMathExpressions. mod(Expression dividend, Expression divisor)Returns the remainder of the first number divided by the second.static ExpressionMathExpressions. multiply(Expression first, Expression... additional)Multiplies numbers together and returns the result.static ExpressionComparisonExpressions. ne(Expression first, Expression second)Returns true if the values are not equivalent.static ExpressionBooleanExpressions. not(Expression value)Evaluates a boolean and returns the opposite boolean value; i.e. when passed an expression that evaluates to true, $not returns false; when passed an expression that evaluates to false, $not returns true.static ExpressionArrayExpressions. objectToArray(Expression array)Converts a document to an array of documents representing key-value pairs.static ExpressionMathExpressions. pow(Expression number, Expression exponent)Raises a number to the specified exponent.static ExpressionAccumulatorExpressions. push(Expression value)Returns an array of expression values for each group.static ExpressionTrigonometryExpressions. radiansToDegrees(Expression value)Converts a value from radians to degrees.static ExpressionMiscellaneous. rand()Returns a random float between 0 and 1.static ExpressionWindowExpressions. rank()Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition.static ExpressionArrayExpressions. reduce(Expression input, Expression initial, Expression in)Applies an expression to each element in an array and combines them into a single value.static ExpressionStringExpressions. replaceAll(Expression input, Expression find, Expression replacement)Replaces all instances of a search string in an input string with a replacement string.static ExpressionStringExpressions. replaceOne(Expression input, Expression find, Expression replacement)Replaces the first instance of a search string in an input string with a replacement string.static ExpressionArrayExpressions. reverseArray(Expression array)Returns an array with the elements in reverse order.static ExpressionMathExpressions. round(Expression number, Expression place)Rounds a number to to a whole integer or to a specified decimal place.static ExpressionSetExpressions. setDifference(Expression first, Expression second)Returns a set with elements that appear in the first set but not in the second set; i.e. performs a relative complement of the second set relative to the first.static ExpressionSetExpressions. setEquals(Expression first, Expression... additional)Returns true if the input sets have the same distinct elements.static ExpressionMiscellaneous. setField(Expression field, Object input, Expression value)Adds, updates, or removes a specified field in a document.static ExpressionMiscellaneous. setField(String field, Object input, Expression value)Adds, updates, or removes a specified field in a document.static ExpressionSetExpressions. setIntersection(Expression first, Expression... additional)Returns a set with elements that appear in all of the input sets.static ExpressionSetExpressions. 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 ExpressionSetExpressions. setUnion(Expression first, Expression... additional)Returns a set with elements that appear in any of the input sets.static ExpressionTrigonometryExpressions. sin(Expression value)Returns the sine of a value that is measured in radians.static ExpressionTrigonometryExpressions. sinh(Expression value)Returns the hyperbolic sine of a value that is measured in radians.static ExpressionArrayExpressions. size(Expression array)Counts and returns the total number of items in an array.static ExpressionArrayExpressions. slice(Expression array, int size)Returns a subset of an array.static ExpressionArrayExpressions. sortArray(Expression input, Sort... sort)Sorts an array based on its elements.static ExpressionStringExpressions. split(Expression input, Expression delimiter)Splits a string into substrings based on a delimiter.static ExpressionMathExpressions. sqrt(Expression value)Calculates the square root.static ExpressionAccumulatorExpressions. stdDevPop(Expression value, Expression... additional)Deprecated.static ExpressionWindowExpressions. stdDevPop(Expression value, Expression... additional)Returns the population standard deviation of the input values.static ExpressionAccumulatorExpressions. stdDevSamp(Expression value, Expression... additional)Deprecated.static ExpressionWindowExpressions. stdDevSamp(Expression value, Expression... additional)Returns the sample standard deviation of the input values.static ExpressionStringExpressions. 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 ExpressionStringExpressions. strLenBytes(Expression input)Returns the number of UTF-8 encoded bytes in a string.static ExpressionStringExpressions. strLenCP(Expression input)Returns the number of UTF-8 code points in a string.static ExpressionStringExpressions. substr(Expression input, int start, int length)Deprecated.Deprecated since version 3.4: $substr is now an alias forStringExpressions.substrBytes(Expression, int, int)static ExpressionStringExpressions. substrBytes(Expression input, int start, int length)Returns the substring of a string.static ExpressionStringExpressions. substrCP(Expression input, int start, int length)Returns the substring of a string.static ExpressionMathExpressions. subtract(Expression minuend, Expression subtrahend)Returns the result of subtracting the second value from the first.static ExpressionAccumulatorExpressions. sum(Expression first, Expression... additional)Calculates and returns the sum of numeric values.static ExpressionTrigonometryExpressions. tan(Expression value)Returns the tangent of a value that is measured in radians.static ExpressionTrigonometryExpressions. tanh(Expression value)Returns the hyperbolic tangent of a value that is measured in radians.static ExpressionTypeExpressions. toBool(Expression input)Converts value to a boolean.static ExpressionTypeExpressions. toDate(Expression input)Converts value to a Date.static ExpressionTypeExpressions. toDecimal(Expression input)Converts value to a Decimal128.static ExpressionTypeExpressions. toDouble(Expression input)Converts value to a double.static ExpressionTypeExpressions. toInt(Expression input)Converts value to an integer.static ExpressionTypeExpressions. toLong(Expression input)Converts value to a long.static ExpressionStringExpressions. toLower(Expression input)Converts a string to lowercase.static ExpressionTypeExpressions. toObjectId(Expression input)Converts value to an ObjectId.static ExpressionAccumulatorExpressions. top(Expression output, Sort... sortBy)Returns the top element within a group according to the specified sort order.static ExpressionAccumulatorExpressions. topN(Expression n, Expression output, Sort... sortBy)Returns an aggregation of the top n elements within a group, according to the specified sort order.static ExpressionStringExpressions. toString(Expression input)Converts value to a string.static ExpressionTypeExpressions. toString(Expression input)Converts value to a string.static ExpressionStringExpressions. toUpper(Expression input)Converts a string to uppercase.static ExpressionMathExpressions. trunc(Expression number, Expression place)Truncates a number to a whole integer or to a specified decimal place.static ExpressionDateExpressions. tsIncrement(Expression expression)Returns the incrementing ordinal from a timestamp as a long.static ExpressionDateExpressions. tsSecond(Expression expression)Returns the seconds from a timestamp as a long.static ExpressionTypeExpressions. type(Expression input)Return the BSON data type of the field.static ExpressionMiscellaneous. unsetField(Expression field, Object input)Removes a specified field in a document.static ExpressionMiscellaneous. unsetField(String field, Object input)Removes a specified field in a document.Methods in dev.morphia.aggregation.expressions with parameters of type Expression Modifier and Type Method Description static ExpressionMathExpressions. abs(Expression value)Returns the absolute value of a number.static ExpressionTrigonometryExpressions. acos(Expression value)Returns the inverse cosine (arc cosine) of a value in radians.static ExpressionTrigonometryExpressions. acosh(Expression value)Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.BooleanExpressions.LogicalExpressionBooleanExpressions.LogicalExpression. add(Expression expression)Adds a new expression to this LogicalExpression.static MathExpressionMathExpressions. add(Expression first, Expression... additional)Adds numbers together or adds numbers and a date.ObjectExpressions.MergeObjectsObjectExpressions.MergeObjects. add(Expression expression)Adds an expression to be mergedstatic ExpressionAccumulatorExpressions. addToSet(Expression value)Returns an array of unique expression values for each group.static ExpressionSetExpressions. allElementsTrue(Expression first, Expression... additional)Returns true if no element of a set evaluates to false, otherwise, returns false.static BooleanExpressions.LogicalExpressionBooleanExpressions. and(Expression first, Expression... additional)Evaluates one or more expressions and returns true if all the expressions are true or if evoked with no argument expressions.static ExpressionSetExpressions. anyElementTrue(Expression first, Expression... additional)Returns true if any elements of a set evaluate to true; otherwise, returns false.static ArrayExpressionArrayExpressions. array(Expression... expressions)Creates an array of the given expressions.static ExpressionArrayExpressions. arrayToObject(Expression array)Converts an array of key value pairs to a document.static ExpressionTrigonometryExpressions. asin(Expression value)Returns the inverse sin (arc sine) of a value in radians.static ExpressionTrigonometryExpressions. asinh(Expression value)Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians.static ExpressionTrigonometryExpressions. atan(Expression value)Returns the inverse tangent (arc tangent) of a value in radians.static ExpressionTrigonometryExpressions. 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 ExpressionTrigonometryExpressions. atanh(Expression value)Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.static ExpressionAccumulatorExpressions. avg(Expression value, Expression... additional)Returns an average of numerical values.static ExpressionDataSizeExpressions. binarySize(Expression expression)Returns the size of a given string or binary data value’s content in bytes.static ExpressionAccumulatorExpressions. bottom(Expression output, Sort... sortBy)Returns the bottom element within a group according to the specified sort order.static ExpressionAccumulatorExpressions. bottomN(Expression n, Expression output, Sort... sortBy)Returns an aggregation of the bottom n elements within a group, according to the specified sort order.static ExpressionDataSizeExpressions. bsonSize(Expression expression)Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON.static ExpressionMathExpressions. ceil(Expression value)Returns the smallest integer greater than or equal to the specified number.static ExpressionComparisonExpressions. 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 ExpressionStringExpressions. concat(Expression first, Expression... additional)Concatenates any number of strings.static ExpressionArrayExpressions. concatArrays(Expression array, Expression additional)Concatenates arrays to return the concatenated array.static ExpressionConditionalExpressions. condition(Expression condition, Expression then, Expression otherwise)Evaluates a boolean expression to return one of the two specified return expressions.static ExpressionTypeExpressions. convert(Expression input, ConvertType to)Converts a value to a specified type.static ExpressionTrigonometryExpressions. cos(Expression value)Returns the cosine of a value that is measured in radians.static ExpressionTrigonometryExpressions. cosh(Expression value)Returns the hyperbolic cosine of a value that is measured in radians.static ExpressionWindowExpressions. covariancePop(Expression first, Expression second)Returns the population covariance of two numeric expressions that are evaluated using documents in the $setWindowFields stage window.static ExpressionWindowExpressions. covarianceSamp(Expression first, Expression second)Returns the sample covariance of two numeric expressions that are evaluated using documents in the $setWindowFields stage window.static DateDeltaExpressionDateExpressions. dateAdd(Expression startDate, long amount, TimeUnit unit)Increments a Date object by a specified number of time units.static DateDiffExpressionDateExpressions. dateDiff(Expression startDate, Expression endDate, TimeUnit unit)Returns the difference between two dates.static DateDeltaExpressionDateExpressions. dateSubtract(Expression startDate, long amount, TimeUnit unit)Decrements a Date object by a specified number of time units.static DateToPartsDateExpressions. dateToParts(Expression date)Constructs and returns a Date object given the date’s constituent properties.static DateTruncExpressionDateExpressions. dateTrunc(Expression date, TimeUnit unit)Truncates a date.static DateExpressions.DateExpressionDateExpressions. dayOfMonth(Expression value)Returns the day of the month for a date as a number between 1 and 31.static DateExpressions.DateExpressionDateExpressions. dayOfWeek(Expression value)Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday).static DateExpressions.DateExpressionDateExpressions. dayOfYear(Expression value)Returns the day of the year for a date as a number between 1 and 366 (leap year).static ExpressionTrigonometryExpressions. degreesToRadians(Expression value)Converts a value from degrees to radians.static CalculusExpressionWindowExpressions. derivative(Expression input)Returns the average rate of change within the specified window.static ExpressionMathExpressions. divide(Expression numerator, Expression divisor)Returns the result of dividing the first number by the second.static DocumentExpressionExpressions. document(String name, Expression expression)Creates a new DocumentExpression.static ExpressionArrayExpressions. elementAt(Expression array, Expression index)Returns the element at the specified array index.static ExpressionComparisonExpressions. eq(Expression first, Expression second)Returns true if the values are equivalent.static ExpressionMathExpressions. exp(Expression value)Raises e to the specified exponent.static ExpressionWindowExpressions. expMovingAvg(Expression input, int n)Returns the exponential moving average of numeric expressions applied to documents in a partition defined in the $setWindowFields stage.static ArrayFilterExpressionArrayExpressions. 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 ExpressionAccumulatorExpressions. first(Expression value)Returns a value from the first document for each group.static ExpressionAccumulatorExpressions. firstN(Expression n, Expression input)Returns an aggregation of the first n elements within a group.static ExpressionMathExpressions. floor(Expression value)Returns the largest integer less than or equal to the specified number.static ExpressionAccumulatorExpressions. function(String body, Expression... args)Defines a custom aggregation function or expression in JavaScript.static ExpressionMiscellaneous. getField(Expression field)Returns the value of a specified field from a document.static ExpressionComparisonExpressions. gt(Expression first, Expression second)Compares two values and returns: true when the first value is greater than the second value.static ExpressionComparisonExpressions. 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.DateExpressionDateExpressions. hour(Expression value)Returns the hour for a date as a number between 0 and 23.static ExpressionArrayExpressions. in(Expression search, Expression array)Returns a boolean indicating whether a specified value is in an array.static ExpressionArrayExpressions. 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 IndexExpressionStringExpressions. 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 IndexExpressionStringExpressions. 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 CalculusExpressionWindowExpressions. integral(Expression input)Returns the approximation of the area under a curve, which is calculated using the trapezoidal rule where each set of adjacent documents form a trapezoid using the:static ExpressionArrayExpressions. isArray(Expression array)Determines if the operand is an array.static ExpressionTypeExpressions. isNumber(Expression input)Checks if the specified expression resolves to one of the numeric BSON types.static IsoDatesDateExpressions. isoDayOfWeek(Expression value)Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday).static IsoDatesDateExpressions. isoWeek(Expression value)Returns the week number in ISO 8601 format, ranging from 1 to 53.static IsoDatesDateExpressions. isoWeekYear(Expression value)Returns the year number in ISO 8601 format.static ExpressionAccumulatorExpressions. last(Expression value)Returns a value from the last document for each group.static ExpressionAccumulatorExpressions. lastN(Expression n, Expression input)Returns an aggregation of the last n elements within a group.static LetExpressionVariableExpressions. let(Expression in)Binds variables for use in the specified expression, and returns the result of the expression.static ExpressionWindowExpressions. linearFill(Expression fillValue)Fills null and missing fields in a window using linear interpolation based on surrounding field values.static ExpressionMathExpressions. ln(Expression value)Calculates the natural log of a number.static ExpressionWindowExpressions. locf(Expression fillValue)Last observation carried forward.static ExpressionMathExpressions. log(Expression number, Expression base)Calculates the log of a number in the specified base.static ExpressionMathExpressions. log10(Expression value)Calculates the log base 10 of a number.static ExpressionComparisonExpressions. lt(Expression first, Expression second)Returns true if the first value is less than the second.static ExpressionComparisonExpressions. 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 TrimExpressionStringExpressions. ltrim(Expression input)Removes whitespace or the specified characters from the beginning of a string.static MapExpressionArrayExpressions. map(Expression input, Expression in)Applies a subexpression to each element of an array and returns the array of resulting values in order.static ExpressionAccumulatorExpressions. max(Expression value)Returns the highest expression value for each group.static ExpressionAccumulatorExpressions. maxN(Expression n, Expression input)Returns an aggregation of the max n elements within a group.static DateExpressions.DateExpressionDateExpressions. milliseconds(Expression value)Returns the milliseconds of a date as a number between 0 and 999.static ExpressionAccumulatorExpressions. min(Expression value)Returns the lowest expression value for each group.static ExpressionAccumulatorExpressions. minN(Expression n, Expression input)Returns an aggregation of the min n elements within a group.static DateExpressions.DateExpressionDateExpressions. minute(Expression value)Returns the minute for a date as a number between 0 and 59.static ExpressionMathExpressions. mod(Expression dividend, Expression divisor)Returns the remainder of the first number divided by the second.static DateExpressions.DateExpressionDateExpressions. month(Expression value)Returns the month for a date as a number between 1 (January) and 12 (December).static ExpressionMathExpressions. multiply(Expression first, Expression... additional)Multiplies numbers together and returns the result.static ExpressionComparisonExpressions. ne(Expression first, Expression second)Returns true if the values are not equivalent.static ExpressionBooleanExpressions. not(Expression value)Evaluates a boolean and returns the opposite boolean value; i.e. when passed an expression that evaluates to true, $not returns false; when passed an expression that evaluates to false, $not returns true.static ExpressionArrayExpressions. objectToArray(Expression array)Converts a document to an array of documents representing key-value pairs.static BooleanExpressions.LogicalExpressionBooleanExpressions. or(Expression first, Expression... additional)Evaluates one or more expressions and returns true if any of the expressions are true.static ExpressionMathExpressions. pow(Expression number, Expression exponent)Raises a number to the specified exponent.static ExpressionAccumulatorExpressions. push(Expression value)Returns an array of expression values for each group.static ExpressionTrigonometryExpressions. radiansToDegrees(Expression value)Converts a value from radians to degrees.static ExpressionArrayExpressions. reduce(Expression input, Expression initial, Expression in)Applies an expression to each element in an array and combines them into a single value.static RegexExpressionStringExpressions. regexFind(Expression input)Applies a regular expression (regex) to a string and returns information on the first matched substring.static RegexExpressionStringExpressions. regexFindAll(Expression input)Applies a regular expression (regex) to a string and returns information on the all matched substrings.static RegexExpressionStringExpressions. 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 ExpressionStringExpressions. replaceAll(Expression input, Expression find, Expression replacement)Replaces all instances of a search string in an input string with a replacement string.static ExpressionStringExpressions. replaceOne(Expression input, Expression find, Expression replacement)Replaces the first instance of a search string in an input string with a replacement string.static ExpressionArrayExpressions. reverseArray(Expression array)Returns an array with the elements in reverse order.static ExpressionMathExpressions. round(Expression number, Expression place)Rounds a number to to a whole integer or to a specified decimal place.static TrimExpressionStringExpressions. rtrim(Expression input)Removes whitespace or the specified characters from the end of a string.static DateExpressions.DateExpressionDateExpressions. second(Expression value)Returns the seconds for a date as a number between 0 and 60 (leap seconds).static ExpressionSetExpressions. setDifference(Expression first, Expression second)Returns a set with elements that appear in the first set but not in the second set; i.e. performs a relative complement of the second set relative to the first.static ExpressionSetExpressions. setEquals(Expression first, Expression... additional)Returns true if the input sets have the same distinct elements.static ExpressionMiscellaneous. setField(Expression field, Object input, Expression value)Adds, updates, or removes a specified field in a document.static ExpressionMiscellaneous. setField(String field, Object input, Expression value)Adds, updates, or removes a specified field in a document.static ExpressionSetExpressions. setIntersection(Expression first, Expression... additional)Returns a set with elements that appear in all of the input sets.static ExpressionSetExpressions. 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 ExpressionSetExpressions. setUnion(Expression first, Expression... additional)Returns a set with elements that appear in any of the input sets.static ShiftExpressionWindowExpressions. shift(Expression output, long by, Expression defaultValue)Returns the value from an expression applied to a document in a specified position relative to the current document in the $setWindowFields stage partition.static ExpressionTrigonometryExpressions. sin(Expression value)Returns the sine of a value that is measured in radians.static ExpressionTrigonometryExpressions. sinh(Expression value)Returns the hyperbolic sine of a value that is measured in radians.static ExpressionArrayExpressions. size(Expression array)Counts and returns the total number of items in an array.static ExpressionArrayExpressions. slice(Expression array, int size)Returns a subset of an array.static ExpressionArrayExpressions. sortArray(Expression input, Sort... sort)Sorts an array based on its elements.static ExpressionStringExpressions. split(Expression input, Expression delimiter)Splits a string into substrings based on a delimiter.static ExpressionMathExpressions. sqrt(Expression value)Calculates the square root.static ExpressionAccumulatorExpressions. stdDevPop(Expression value, Expression... additional)Deprecated.static ExpressionWindowExpressions. stdDevPop(Expression value, Expression... additional)Returns the population standard deviation of the input values.static ExpressionAccumulatorExpressions. stdDevSamp(Expression value, Expression... additional)Deprecated.static ExpressionWindowExpressions. stdDevSamp(Expression value, Expression... additional)Returns the sample standard deviation of the input values.static ExpressionStringExpressions. 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 ExpressionStringExpressions. strLenBytes(Expression input)Returns the number of UTF-8 encoded bytes in a string.static ExpressionStringExpressions. strLenCP(Expression input)Returns the number of UTF-8 code points in a string.static ExpressionStringExpressions. substr(Expression input, int start, int length)Deprecated.Deprecated since version 3.4: $substr is now an alias forStringExpressions.substrBytes(Expression, int, int)static ExpressionStringExpressions. substrBytes(Expression input, int start, int length)Returns the substring of a string.static ExpressionStringExpressions. substrCP(Expression input, int start, int length)Returns the substring of a string.static ExpressionMathExpressions. subtract(Expression minuend, Expression subtrahend)Returns the result of subtracting the second value from the first.static ExpressionAccumulatorExpressions. sum(Expression first, Expression... additional)Calculates and returns the sum of numeric values.static ExpressionTrigonometryExpressions. tan(Expression value)Returns the tangent of a value that is measured in radians.static ExpressionTrigonometryExpressions. tanh(Expression value)Returns the hyperbolic tangent of a value that is measured in radians.static ExpressionTypeExpressions. toBool(Expression input)Converts value to a boolean.static DateExpressions.DateExpressionDateExpressions. toDate(Expression value)Converts a value to a date.static ExpressionTypeExpressions. toDate(Expression input)Converts value to a Date.static ExpressionTypeExpressions. toDecimal(Expression input)Converts value to a Decimal128.static ExpressionTypeExpressions. toDouble(Expression input)Converts value to a double.static ExpressionTypeExpressions. toInt(Expression input)Converts value to an integer.static ExpressionTypeExpressions. toLong(Expression input)Converts value to a long.static ExpressionStringExpressions. toLower(Expression input)Converts a string to lowercase.static ExpressionTypeExpressions. toObjectId(Expression input)Converts value to an ObjectId.static ExpressionAccumulatorExpressions. top(Expression output, Sort... sortBy)Returns the top element within a group according to the specified sort order.static ExpressionAccumulatorExpressions. topN(Expression n, Expression output, Sort... sortBy)Returns an aggregation of the top n elements within a group, according to the specified sort order.static ExpressionStringExpressions. toString(Expression input)Converts value to a string.static ExpressionTypeExpressions. toString(Expression input)Converts value to a string.static ExpressionStringExpressions. toUpper(Expression input)Converts a string to uppercase.static TrimExpressionStringExpressions. trim(Expression input)Removes whitespace or the specified characters from the beginning and end of a string.static ExpressionMathExpressions. trunc(Expression number, Expression place)Truncates a number to a whole integer or to a specified decimal place.static ExpressionDateExpressions. tsIncrement(Expression expression)Returns the incrementing ordinal from a timestamp as a long.static ExpressionDateExpressions. tsSecond(Expression expression)Returns the seconds from a timestamp as a long.static ExpressionTypeExpressions. type(Expression input)Return the BSON data type of the field.static ExpressionMiscellaneous. unsetField(Expression field, Object input)Removes a specified field in a document.static DateExpressions.DateExpressionDateExpressions. 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.DateExpressionDateExpressions. year(Expression value)Returns the year for a date as a number (e.g. 2014).static ZipExpressionArrayExpressions. zip(Expression... arrays)Merge two arrays together.Method parameters in dev.morphia.aggregation.expressions with type arguments of type Expression Modifier and Type Method Description static AccumulatorExpressionAccumulatorExpressions. 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.expressions with parameters of type Expression Constructor Description DateExpression(String operation, Expression value) -
Uses of Expression in dev.morphia.aggregation.expressions.impls
Subclasses of Expression in dev.morphia.aggregation.expressions.impls Modifier and Type Class Description classAccumulatorBase class for the accumulator expression types.classAccumulatorExpressionclassArrayExpressionBase class for the array expressionsclassArrayFilterExpressionclassArrayIndexExpressionclassArrayLiteralclassCalculusExpressionCommon type for $derivative and $integralclassConvertExpressionclassDateDeltaExpressionChanges a Date object by a specified number of time units.classDateDiffExpressionReturns the difference between two dates.classDateFromPartsclassDateFromStringclassDateToPartsReturns a document that contains the constituent parts of a given BSON Date value as individual properties.classDateToStringclassDateTruncExpressionTruncates a date.classDocumentExpressionclassEndResultsExpressionGives first/last resultsclassExpMovingAvgclassExpressionListWraps a list of expressions as an Expression so we can generically deal with all values as ExpressionsclassFunctionExpressionclassIfNullclassIndexExpressionDefines the $indexOfBytes expressionclassIsoDatesReusable type for ISO Date related expressions.classLetExpressionclassLiteralExpressionclassMapExpressionclassMathExpressionBase class for the math expressionsclassMetaExpressionclassNRankedResultsExpressionclassPushclassRangeExpressionclassRankedResultsExpressionclassReduceExpressionclassRegexExpressionclassReplaceExpressionDefines expressions for $replaceAll and $replaceOneclassSetFieldExpressionclassShiftExpressionclassSliceExpressionclassSwitchExpressionEvaluates a series of case expressions.classTrimExpressionclassUnsetFieldExpressionclassValueExpressionclassZipExpressionMethods in dev.morphia.aggregation.expressions.impls that return Expression Modifier and Type Method Description ExpressionIfNull. getReplacement()ExpressionIfNull. getTarget()ExpressionExpression. getValue()ExpressionExpressionList. getValue()ExpressionPipelineField. getValue()Methods in dev.morphia.aggregation.expressions.impls that return types with arguments of type Expression Modifier and Type Method Description List<Expression>ExpressionList. getValues()Methods in dev.morphia.aggregation.expressions.impls with parameters of type Expression Modifier and Type Method Description voidExpressionList. add(Expression expression)TFields. add(String name, Expression expression)SwitchExpressionSwitchExpression. branch(Expression caseExpression, Expression then)Adds a new branch to the switchTrimExpressionTrimExpression. chars(Expression chars)static ExpressionListExpressionList. coalesce(Expression first, Expression... values)DateToStringDateToString. date(Expression date)DateFromStringDateFromString. dateString(Expression dateString)DateFromPartsDateFromParts. day(Expression value)Day of month.SwitchExpressionSwitchExpression. defaultCase(Expression caseExpression)Adds a default case if nothing is matched.ZipExpressionZipExpression. defaults(Expression defaults)An array of default element values to use if the input arrays have different lengths.DocumentExpressionDocumentExpression. field(String name, Expression expression)TFieldHolder. field(String name, Expression expression)IfNullIfNull. field(String name, Expression expression)PushPush. field(String name, Expression expression)DateFromStringDateFromString. format(Expression format)DateToStringDateToString. format(Expression format)DateFromPartsDateFromParts. hour(Expression value)Can be any expression that evaluates to a number.DateFromPartsDateFromParts. isoDayOfWeek(Expression value)Day of week (Monday 1 - Sunday 7).DateFromPartsDateFromParts. isoWeek(Expression value)Week of year.DateFromPartsDateFromParts. isoWeekYear(Expression value)ISO Week Date Year.DateFromPartsDateFromParts. millisecond(Expression value)Can be any expression that evaluates to a number.DateFromPartsDateFromParts. minute(Expression value)Can be any expression that evaluates to a number.DateFromPartsDateFromParts. month(Expression value)Can be any expression that evaluates to a number.ConvertExpressionConvertExpression. onError(Expression onError)The value to return on encountering an error during conversion, including unsupported type conversions.DateFromStringDateFromString. onError(Expression onError)ConvertExpressionConvertExpression. onNull(Expression onNull)The value to return if the input is null or missing.DateFromStringDateFromString. onNull(Expression onNull)DateToStringDateToString. onNull(Expression onNull)IfNullIfNull. replacement(Expression replacement)DateFromPartsDateFromParts. second(Expression value)Can be any expression that evaluates to a number.PushPush. single(Expression source)IfNullIfNull. target(Expression target)DateDeltaExpressionDateDeltaExpression. timezone(Expression timezone)The timezone to carry out the operation.DateDiffExpressionDateDiffExpression. timezone(Expression timezone)The timezone to carry out the operation.DateFromPartsDateFromParts. 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. "+04:45", or +/-[hh][mm], e.g. "-0530", or +/-[hh], e.g. "+03".DateToPartsDateToParts. timezone(Expression timezone)The optional timezone to use to format the date.DateTruncExpressionDateTruncExpression. timezone(Expression timezone)The timezone to carry out the operation.IsoDatesIsoDates. timezone(Expression timezone)The optional timezone to use to format the date.DateFromStringDateFromString. timeZone(Expression timeZone)DateToStringDateToString. timeZone(Expression timeZone)LetExpressionLetExpression. variable(String name, Expression expression)Defines a new variableDateFromPartsDateFromParts. year(Expression value)Calendar year.Method parameters in dev.morphia.aggregation.expressions.impls with type arguments of type Expression Modifier and Type Method Description AccumulatorExpressionAccumulatorExpression. initArgs(List<Expression> initArgs)Optional.Constructor parameters in dev.morphia.aggregation.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)ArrayExpression(String operation, List<Expression> value)Expression(String operation, List<Expression> value)ExpressionList(List<Expression> values)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.stages
Methods in dev.morphia.aggregation.stages that return Expression Modifier and Type Method Description ExpressionRedact. getExpression()ExpressionSortByCount. getExpression()ExpressionGroup.GroupId. getField()ExpressionAutoBucket. getGroupBy()ExpressionBucket. getGroupBy()ExpressionUnwind. getPath()ExpressionGraphLookup. getStartWith()ExpressionReplaceRoot. getValue()ExpressionReplaceWith. getValue()ExpressionSetWindowFields.Output. operator()ExpressionSetWindowFields. partition()ExpressionFill. partitionBy()Methods in dev.morphia.aggregation.stages that return types with arguments of type Expression Modifier and Type Method Description List<Expression>Unset. getFields()Map<String,Expression>Merge. getVariables()Methods in dev.morphia.aggregation.stages with parameters of type Expression Modifier and Type Method Description BucketBucket. boundaries(Expression... boundaries)An array of values based on the groupBy expression that specify the boundaries for each bucket.AddFieldsAddFields. field(String name, Expression value)Add a field to the stageGroupGroup. field(String name, Expression expression)Adds a named field to the group with an expression giving the value.Group.GroupIdGroup.GroupId. field(String name, Expression expression)Adds a named field to the group with an expression giving the value.ReplaceRootReplaceRoot. field(String name, Expression expression)Adds a new fieldReplaceWithReplaceWith. field(String name, Expression expression)Adds a new fieldSetSet. field(String name, Expression value)Add a field to the stageAutoBucketAutoBucket. groupBy(Expression groupBy)An expression to group documents by.BucketBucket. groupBy(Expression groupBy)An expression to group documents by.static Group.GroupIdGroup. id(Expression name)Creates a named group IDProjectionProjection. include(String name, Expression value)Includes a field.LookupLookup. 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 RedactRedact. on(Expression expression)Deprecated, for removal: This API element is subject to removal in a future version.static SortByCountSortByCount. on(Expression expression)Deprecated, for removal: This API element is subject to removal in a future version.SetWindowFields.OutputSetWindowFields.Output. operator(Expression operator)The operator to use in the output.AutoBucketAutoBucket. 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.BucketBucket. 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.FillFill. partitionBy(Expression partitionBy)Specifies an array of fields as the compound key to group the documents.SetWindowFieldsSetWindowFields. partitionBy(Expression partition)Defines the expression to use to partition the data.static RedactRedact. redact(Expression expression)Creates a redaction stage with the given expressionstatic ReplaceRootReplaceRoot. replaceRoot(Expression expression)Creates a new stage to replace the root with the given expression.static ReplaceWithReplaceWith. replaceWith(Expression expression)Creates a new stage to replace the root with the given expression.static SortByCountSortByCount. sortByCount(Expression expression)Creates a new stage grouping by the given expression.GraphLookupGraphLookup. startWith(Expression startWith)Expression that specifies the value of the connectFromField with which to start the recursive search.static ReplaceRootReplaceRoot. with(Expression expression)Deprecated, for removal: This API element is subject to removal in a future version.static ReplaceWithReplaceWith. with(Expression expression)Deprecated, for removal: This API element is subject to removal in a future version.Constructors in dev.morphia.aggregation.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.filters
Methods in dev.morphia.query.filters with parameters of type Expression Modifier and Type Method Description static FilterFilters. expr(Expression expression)Allows use of aggregation expressions within the query language.
-