Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsArrayValueOperators

ArrayValueOperators

Operators to manipulate arrays.

To learn more about aggregation operators, see opensavvy.ktmongo.dsl.aggregation.AggregationOperators.

Inheritors

Properties

context

abstract val context: 

field

Converts a Kotlin property into a Field.

Functions

div

open operator fun <Context : Any, Root, Child> Value<Context, Root>.div(field: KProperty1<Root, Child>): Value<Context, Child>

Refers to field as a nested field of the current value.

open operator fun <Context : Any, Root, Child> Value<Context, Root>.div(field: Field<Root, Child>): Value<Context, Child>

Refers to field as a nested field of the current value.

open operator fun <Root, Parent, Child> KProperty1<Root, Parent>.div(child: KProperty1<Parent & Any, Child>): Field<Root, Child>

Refers to child as a nested field of the current field.

filter

open fun <Context : Any, T> Collection<T>.filter(limit: Value<Context, Number>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>

Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.

open fun <Context : Any, T> KProperty1<Context, Collection<T>>.filter(limit: Value<Context, Number>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>

Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.

open fun <Context : Any, T> Value<Context, Collection<T>>.filter(limit: Value<Context, Number>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>

Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.

open fun <Context : Any, T> Field<Context, Collection<T>>.filter(limit: Value<Context, Number>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>

Selects a subset of an array to return based on the specified predicate, similarly to kotlin.collections.filter.

get

open operator fun <Root, Type> KProperty1<Root, Collection<Type>>.get(index: Int): Field<Root, Type>

Refers to a specific item in an array, by its index.

open operator fun <Root, Type> KProperty1<Root, Map<String, Type>>.get(index: String): Field<Root, Type>

Refers to a specific item in a map, by its name.

map

open fun <Context : Any, T, R> Collection<T>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>

Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.

open fun <Context : Any, T, R> KProperty1<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>

Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.

open fun <Context : Any, T, R> Value<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>

Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.

open fun <Context : Any, T, R> Field<Context, Collection<T>>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>

Applies a transform to all elements in an array and returns the array with the applied results, similar to kotlin.collections.map.

of

open fun <Result> of(value: Result): Value<Any, Result>

Refers to a Kotlin value within an aggregation value.

open fun of(value: ): Value<Any, >

Refers to a BsonType within an aggregation value.

Refers to a field within an aggregation value.

open fun <Context : Any, Result> of(field: Field<Context, Result>): Value<Context, Result>

Refers to a field within an aggregation value.

sorted

open fun <Context : Any, T> Collection<T>.sorted(): Value<Context, List<T>>

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

open fun <Context : Any, T> Collection<T>.sortedBy(order: SortOptionDsl<T & Any>.() -> Unit): Value<Context, List<T>>

Sorts an array based on fields of its elements.

Sorts an array based on fields of its elements.

open fun <Context : Any, T> Value<Context, Collection<T>>.sortedBy(order: SortOptionDsl<T & Any>.() -> Unit): Value<Context, List<T>>

Sorts an array based on fields of its elements.

open fun <Context : Any, T> Field<Context, Collection<T>>.sortedBy(order: SortOptionDsl<T & Any>.() -> Unit): Value<Context, List<T>>

Sorts an array based on fields of its elements.

sortedDescending

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.

Sorts an array based on its elements, in descending order.

take

open fun <Context : Any, T> Collection<T>.take(limit: Value<Context, Number>): Value<Context, List<T>>

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.