ArrayValueOperators

Operators to manipulate arrays.

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

Inheritors

Properties

Link copied to clipboard
abstract override val context: BsonContext

The strategy used when converting from KProperty1 to Field.

Link copied to clipboard

Converts a Kotlin property into a Field.

Functions

Link copied to clipboard
open fun <Context : Any, T : Number> average(): Value<Context, T>

@JvmName(name = "averageResultReceiver")
open fun <Context : Any, T : Number> Collection<Number?>.average(): Value<Context, T>
@JvmName(name = "averagePropertyReceiver")
open fun <Context : Any, T : Number> KProperty1<Context, Collection<Number?>>.average(): Value<Context, T>
@JvmName(name = "averageFieldReceiver")
open fun <Context : Any, T : Number> Field<Context, Collection<Number?>>.average(): Value<Context, T>
@JvmName(name = "averageByProperty")
open fun <Context : Any, T : Number> average(vararg input: KProperty1<Context, Number?>): Value<Context, T>
open fun <Context : Any, T : Number> average(vararg input: Value<Context, Number?>): Value<Context, T>
@JvmName(name = "averageByField")
open fun <Context : Any, T : Number> average(vararg input: Field<Context, Number?>): Value<Context, T>

Returns the average of the elements in the array.

Link copied to clipboard
@JvmName(name = "divResultReceiver")
inline operator fun <Context : Any, Root, Child> Root.div(field: KProperty1<Root, Child>): Value<Context, Child>
@JvmName(name = "divResultReceiver")
inline operator fun <Context : Any, Root, Child> Root.div(field: Field<Root, Child>): Value<Context, Child>
open operator fun <Context : Any, Root, Child> Value<Context, Root>.div(field: KProperty1<Root, Child>): Value<Context, Child>
open operator fun <Context : Any, Root, Child> Value<Context, Root>.div(field: Field<Root, Child>): Value<Context, Child>
@JvmName(name = "divFieldReceiver")
open operator fun <Context : Any, Root, Child> Field<Context, Root>.div(field: KProperty1<Root, Child>): Value<Context, Child>
@JvmName(name = "divFieldReceiver")
open operator fun <Context : Any, Root, Child> Field<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>
open operator fun <Root, Type, Child> Field<Root, Type>.div(child: KProperty1<in Type & Any, Child>): Field<Root, Child>
open operator fun <Root, Type, Child> Field<Root, Type>.div(child: Field<Type, Child>): Field<Root, Child>

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

Link copied to clipboard
@JvmName(name = "filterResultReceiverByResult")
open fun <Context : Any, T> Collection<T>.filter(limit: Int, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterResultReceiverByProperty")
open fun <Context : Any, T> Collection<T>.filter(limit: KProperty1<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterResultReceiverByValue")
open fun <Context : Any, T> Collection<T>.filter(limit: Value<Context, Int>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterResultReceiverByField")
open fun <Context : Any, T> Collection<T>.filter(limit: Field<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterPropertyReceiverByResult")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.filter(limit: Int, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterPropertyReceiverByProperty")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.filter(limit: KProperty1<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterPropertyReceiverByValue")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.filter(limit: Value<Context, Int>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterPropertyReceiverByField")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.filter(limit: Field<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
open fun <Context : Any, T> Value<Context, Collection<T>>.filter(limit: Int, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterByProperty")
open fun <Context : Any, T> Value<Context, Collection<T>>.filter(limit: KProperty1<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
open fun <Context : Any, T> Value<Context, Collection<T>>.filter(limit: Value<Context, Int>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterByField")
open fun <Context : Any, T> Value<Context, Collection<T>>.filter(limit: Field<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterFieldReceiverByResult")
open fun <Context : Any, T> Field<Context, Collection<T>>.filter(limit: Int, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterFieldReceiverByProperty")
open fun <Context : Any, T> Field<Context, Collection<T>>.filter(limit: KProperty1<Context, Int>, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterFieldReceiverByValue")
open fun <Context : Any, T> Field<Context, Collection<T>>.filter(limit: Value<Context, Int>? = null, variableName: String = "this", predicate: AggregationOperators.(Value<Any, T>) -> Value<T & Any, Boolean>): Value<Context, List<T>>
@JvmName(name = "filterFieldReceiverByField")
open fun <Context : Any, T> Field<Context, Collection<T>>.filter(limit: Field<Context, Int>, 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's filter.

Link copied to clipboard
open operator fun <Root, Type> KProperty1<Root, Collection<Type>>.get(index: Int): Field<Root, Type>
open operator fun <Root, Type> Field<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>
open operator fun <Root, Type> Field<Root, Map<String, Type>>.get(key: String): Field<Root, Type>

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

Link copied to clipboard
@JvmName(name = "mapResultReceiver")
open fun <Context : Any, T, R> Collection<T>.map(variableName: String = "this", transform: AggregationOperators.(Value<Any, T>) -> Value<Context, R>): Value<Context, List<R>>
@JvmName(name = "mapPropertyReceiver")
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>>
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>>
@JvmName(name = "mapFieldReceiver")
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.

Link copied to clipboard
inline fun <Result> of(value: Result): Value<Any, Result>
open fun <Result> of(value: Result, type: KType): Value<Any, Result>

Refers to a Kotlin value 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.

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

Refers to a BsonType within an aggregation value.

Link copied to clipboard
@JvmName(name = "sortedResultReceiver")
open fun <Context : Any, T> Collection<T>.sorted(): Value<Context, List<T>>
@JvmName(name = "sortedPropertyReceiver")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.sorted(): Value<Context, List<T>>
@JvmName(name = "sortedFieldReceiver")
open fun <Context : Any, T> Field<Context, Collection<T>>.sorted(): Value<Context, List<T>>

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

Link copied to clipboard
@JvmName(name = "sortedByResultReceiver")
open fun <Context : Any, T> Collection<T>.sortedBy(order: SortOptionDsl<T & Any>.() -> Unit): Value<Context, List<T>>
@JvmName(name = "sortedByPropertyReceiver")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.sortedBy(order: SortOptionDsl<T & Any>.() -> Unit): Value<Context, List<T>>
@JvmName(name = "sortedByFieldReceiver")
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.

Link copied to clipboard
@JvmName(name = "sortedDescendingResultReceiver")
open fun <Context : Any, T> Collection<T>.sortedDescending(): Value<Context, List<T>>
@JvmName(name = "sortedDescendingPropertyReceiver")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.sortedDescending(): Value<Context, List<T>>
@JvmName(name = "sortedDescendingFieldReceiver")
open fun <Context : Any, T> Field<Context, Collection<T>>.sortedDescending(): Value<Context, List<T>>

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

Link copied to clipboard
@JvmName(name = "takeResultReceiverByResult")
inline fun <Context : Any, T> Collection<T>.take(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeResultReceiverByProperty")
open fun <Context : Any, T> Collection<T>.take(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeResultReceiverByValue")
open fun <Context : Any, T> Collection<T>.take(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeResultReceiverByField")
open fun <Context : Any, T> Collection<T>.take(limit: Field<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takePropertyReceiverByResult")
inline fun <Context : Any, T> KProperty1<Context, Collection<T>>.take(limit: Int): Value<Context, List<T>>
@JvmName(name = "takePropertyReceiverByProperty")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.take(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takePropertyReceiverByValue")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.take(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takePropertyReceiverByField")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.take(limit: Field<Context, Int>): Value<Context, List<T>>
inline fun <Context : Any, T> Value<Context, Collection<T>>.take(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeByProperty")
open fun <Context : Any, T> Value<Context, Collection<T>>.take(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeByField")
open fun <Context : Any, T> Value<Context, Collection<T>>.take(limit: Field<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeFieldReceiverByResult")
inline fun <Context : Any, T> Field<Context, Collection<T>>.take(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeFieldReceiverByProperty")
open fun <Context : Any, T> Field<Context, Collection<T>>.take(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeFieldReceiverByValue")
open fun <Context : Any, T> Field<Context, Collection<T>>.take(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeFieldReceiverByField")
open fun <Context : Any, T> Field<Context, Collection<T>>.take(limit: Field<Context, Int>): Value<Context, List<T>>

Returns the first limit elements in an array, similar to kotlin.collections.take.

Link copied to clipboard
@JvmName(name = "takeLastResultReceiverByResult")
inline fun <Context : Any, T> Collection<T>.takeLast(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeLastResultReceiverByProperty")
open fun <Context : Any, T> Collection<T>.takeLast(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastResultReceiverByValue")
open fun <Context : Any, T> Collection<T>.takeLast(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastResultReceiverByField")
open fun <Context : Any, T> Collection<T>.takeLast(limit: Field<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastPropertyReceiverByResult")
inline fun <Context : Any, T> KProperty1<Context, Collection<T>>.takeLast(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeLastPropertyReceiverByProperty")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.takeLast(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastPropertyReceiverByValue")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.takeLast(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastPropertyReceiverByField")
open fun <Context : Any, T> KProperty1<Context, Collection<T>>.takeLast(limit: Field<Context, Int>): Value<Context, List<T>>
inline fun <Context : Any, T> Value<Context, Collection<T>>.takeLast(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeLastByProperty")
open fun <Context : Any, T> Value<Context, Collection<T>>.takeLast(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastByField")
open fun <Context : Any, T> Value<Context, Collection<T>>.takeLast(limit: Field<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastFieldReceiverByResult")
inline fun <Context : Any, T> Field<Context, Collection<T>>.takeLast(limit: Int): Value<Context, List<T>>
@JvmName(name = "takeLastFieldReceiverByProperty")
open fun <Context : Any, T> Field<Context, Collection<T>>.takeLast(limit: KProperty1<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastFieldReceiverByValue")
open fun <Context : Any, T> Field<Context, Collection<T>>.takeLast(limit: Value<Context, Int>): Value<Context, List<T>>
@JvmName(name = "takeLastFieldReceiverByField")
open fun <Context : Any, T> Field<Context, Collection<T>>.takeLast(limit: Field<Context, Int>): Value<Context, List<T>>

Returns the last limit elements in an array, similar to kotlin.collections.takeLast.

Link copied to clipboard
open infix fun <Root, Child> KProperty1<Root, *>.unsafe(child: String): Field<Root, Child>
open infix fun <Root, Type, Child> Field<Root, Type>.unsafe(child: String): Field<Root, Child>

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>
open infix fun <Root, Child> KProperty1<Root, *>.unsafe(child: Field<*, Child>): Field<Root, Child>
open infix fun <Root, Child> Field<Root, *>.unsafe(child: KProperty1<*, Child>): Field<Root, Child>
open infix fun <Root, Child> Field<Root, *>.unsafe(child: Field<*, 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.