MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation • AccumulationOperators
AccumulationOperators¶
interface AccumulationOperators<From : Any, Into : Any> : ValueAccumulators<From, Into> , AggregationOperators, ArithmeticValueAccumulators<From, Into>
DSL to accumulate values into each other, available in the `$group stage`.
Accumulation operators are a specific type of aggregation operators.
Operators¶
Arithmetic operators:
See also¶
-
ValueRepresentation of an aggregation value. -
AggregationOperatorsLearn more about regular aggregation operators.
Properties¶
context¶
abstract val context:
field¶
Converts a Kotlin property into a Field.
isArray¶
Determines if this value is an array.
isNumber¶
Determines if this value is a number.
length¶
Returns the number of code points in the specified string.
lengthUTF8¶
Returns the number of UTF-8 encoded bytes in the specified string.
type¶
Gets the BsonType of the current value.
Functions¶
abs¶
The absolute value of a number.
accept¶
Adds a new node as a child of this one.
acceptAll¶
Adds any number of nodes into this one.
acos¶
The inverse cosine (arc cosine) of a value, in radians.
acosh¶
The inverse hyperbolic cosine (hyperbolic arc cosine) of a value, in radians.
asin¶
The inverse sine (arc sine) of a value, in radians.
asinh¶
The inverse hyperbolic sine (hyperbolic arc sine) of a value, in radians.
atan¶
The inverse tangent (arc tangent) of a value, in radians.
atanh¶
The inverse hyperbolic tangent (hyperbolic arc tangent) of a value, in radians.
average¶
Calculates and returns the collective average of numeric values. Non-numeric values are ignored.
Calculates and returns the collective average of numeric values. Non-numeric values are ignored.
Returns the average of the elements in the array.
Returns the average of the elements in the array.
Returns the average of the elements in the array.
Returns the average of the elements in the array.
Returns the average of the elements in the array.
ceil¶
The smallest integer greater than or equal to the specified value.
concat¶
Concatenates strings together.
Concatenates strings together.
Concatenates strings together.
cond¶
Decides between two values depending on the evaluation of a boolean value.
cos¶
The cosine of a value that is measured in radians.
cosh¶
The hyperbolic cosine of a value that is measured in radians.
div¶
Divides one aggregation value by another.
Refers to field as a nested field of the current value.
Refers to field as a nested field of the current value.
Refers to child as a nested field of the current field.
eq¶
Compares two aggregation values and returns true if they are equivalent.
filter¶
Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.
Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.
Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.
Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.
floor¶
The largest integer less than or equal to the specified value.
freeze¶
abstract override fun freeze()
Makes this expression immutable.
get¶
Refers to a specific item in an array, by its index.
Refers to a specific item in a map, by its name.
gt¶
gte¶
lowercase¶
Converts a string to lowercase, returning the result.
lt¶
lte¶
map¶
Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.
Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.
Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.
Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.
minus¶
Subtracts one aggregation value from another.
ne¶
Compares two aggregation values and returns true if they are not equivalent.
of¶
Refers to a Kotlin value within an aggregation value.
Refers to a BsonType within an aggregation value.
Refers to a field within an aggregation value.
Refers to a field within an aggregation value.
plus¶
Sums two aggregation values.
replace¶
Replaces all instances of find with a replacement string.
Replaces all instances of find with a replacement string.
replaceFirst¶
Replaces the first instance of find with a replacement string.
Replaces the first instance of find with a replacement string.
simplify¶
Returns a simplified (but equivalent) expression to the current expression.
sin¶
The sine of a value that is measured in radians.
sinh¶
The hyperbolic sine of a value that is measured in radians.
sorted¶
Sorts an array based on its elements, in ascending order.
Sorts an array based on its elements, in ascending order.
Sorts an array based on its elements, in ascending order.
Sorts an array based on its elements, in ascending order.
sortedBy¶
Sorts an array based on fields of its elements.
Sorts an array based on fields of its elements.
Sorts an array based on fields of its elements.
Sorts an array based on fields of its elements.
sortedDescending¶
open fun <Context : Any, T> Collection<T>.sortedDescending(): Value<Context, List<T>>
Sorts an array based on its elements, in descending order.
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.sortedDescending(): Value<Context, List<T>>
Sorts an array based on its elements, in descending order.
Sorts an array based on its elements, in descending order.
Sorts an array based on its elements, in descending order.
split¶
Divides a string into an array of substrings based on a delimiter.
Divides a string into an array of substrings based on a delimiter.
substring¶
Returns the substring of a string.
Returns the substring of a string.
substringUTF8¶
Returns the substring of a string.
Returns the substring of a string.
sum¶
Calculates and returns the collective sum of numeric values. Non-numeric values are ignored.
Calculates and returns the collective sum of numeric values. Non-numeric values are ignored.
switch¶
Selects one value based on multiple conditions.
take¶
Returns the first limit elements in an array, similar to kotlin.collections.take.
Returns the first limit elements in an array, similar to kotlin.collections.take.
Returns the first limit elements in an array, similar to kotlin.collections.take.
Returns the first limit elements in an array, similar to kotlin.collections.take.
takeLast¶
Returns the last limit elements in an array, similar to kotlin.collections.takeLast.
Returns the last limit elements in an array, similar to kotlin.collections.takeLast.
Returns the last limit elements in an array, similar to kotlin.collections.takeLast.
Returns the last limit elements in an array, similar to kotlin.collections.takeLast.
tan¶
The tangent of a value that is measured in radians.
tanh¶
The hyperbolic tangent of a value that is measured in radians.
times¶
Multiplies two or more aggregation values.
toBoolean¶
Converts this value to a BsonType.Boolean.
toBson¶
open fun toBson():
Writes the result of simplifying to a new Bson.
toDegrees¶
Converts an angle in radians to an angle in degrees.
toDouble¶
Converts this value to a BsonType.Double.
toInstant¶
Converts this value to an Instant (BsonType.Datetime).
toInt¶
Converts this value to an Int (BsonType.Int32).
toLong¶
Converts this value to an Long (BsonType.Int64).
toObjectId¶
Converts this value to an ObjectId.
toRadians¶
Converts an angle in degrees to an angle in radians.
toText¶
Converts this value to a String.
toUuid¶
Converts a string value to a Uuid (BsonType.BinaryData).
trim¶
Removes whitespace characters, including null, or the specified characters from the beginning and end of a string.
Removes the specified characters from the beginning and end of a string.
Removes the specified characters from the beginning and end of a string.
trimEnd¶
Removes whitespace characters, including null, or the specified characters from the end of a string.
Removes the specified characters from the end of a string.
Removes the specified characters from the end of a string.
trimStart¶
Removes whitespace characters, including null, or the specified characters from the beginning of a string.
Removes the specified characters from the beginning of a string.
Removes the specified characters from the beginning of a string.
unsafe¶
Refers to a field child of the current field, with no compile-time safety.
open infix fun <Root, Child> KProperty1<Root, *>.unsafe(child: KProperty1<*, Child>): Field<Root, Child>
Refers to a field child of the current field, without checking that it is a field available on the current object.
Refers to a field child of the current field, without checking that it is a field available on the current object.
Refers to a field child of the current field, without checking that it is a field available on the current object.
Refers to a field child of the current field, without checking that it is a field available on the current object.
uppercase¶
Converts a string to uppercase, returning the result.
writeTo¶
abstract fun writeTo(writer: )
Writes the result of simplifying this expression into writer.