ArrayValueAccumulators¶
interface ArrayValueAccumulators<From : Any, Into : Any> : ValueAccumulators<From, Into>
Accumulators to create arrays.
To learn more about accumulation operators, see AccumulationOperators.
Inheritors¶
Properties¶
context¶
@LowLevelApi
abstract override val context: BsonContext
The strategy used when converting from KProperty1 to Field.
field¶
Converts a Kotlin property into a Field.
Functions¶
accept¶
@LowLevelApi
@DangerousMongoApi
abstract override fun accept(node: BsonNode)
Adds a new node as a child of this one.
acceptAll¶
@LowLevelApi
@DangerousMongoApi
fun <N : Node> CompoundNode<N>.acceptAll(nodes: Iterable<N>)
Adds any number of nodes into this one.
addToSet¶
@JvmName(name = "addToSetByField")
open infix fun <T> Field<Into, Collection<T>>.addToSet(value: Field<From, T>)
@JvmName(name = "addToSetPropertyReceiverByField")
open infix fun <T> KProperty1<Into, Collection<T>>.addToSet(value: Field<From, T>)
@JvmName(name = "addToSetByProperty")
open infix fun <T> Field<Into, Collection<T>>.addToSet(value: KProperty1<From, T>)
@JvmName(name = "addToSetPropertyReceiverByProperty")
open infix fun <T> KProperty1<Into, Collection<T>>.addToSet(value: KProperty1<From, T>)
infix inline fun <T> KProperty1<Into, Collection<T>>.addToSet(value: T)
open infix fun <T> KProperty1<Into, Collection<T>>.addToSet(value: Value<From, T>)
Accumulates value into an array of unique values.
Duplicate values are ignored.
The order of values in the resulting array is not specified.
Example
class User(
val _id: String,
val age: Int,
val cityName: String,
)
class AgesByCity(
val _id: String, // City name
val ages: List<Int>,
)
users.aggregate()
.group {
AgesByCity::_id set User::cityName
AgesByCity::ages addToSet User::age
}
External resources
div¶
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.
Refers to child as a nested field of the current field.
Refers to child as a nested field of the current field.
freeze¶
@LowLevelApi
abstract override fun freeze()
Makes this node immutable.
get¶
Refers to a specific item in an array, by its index.
Refers to a specific item in an array, by its index.
Refers to a specific item in an array, by its index.
Refers to a specific item in an array, by its index.
Refers to a child field of a field of type BsonDocument.
Refers to a child field of a field of type BsonDocument.
Refers to a specific item in an array, by its index.
Refers to a specific item in a map, by its name.
Refers to a child item of a field of type BsonArray.
Refers to a child field of a field of type BsonDocument.
@JvmName(name = "bsonField")
operator fun <Child> BsonDocument.Companion.get(field: String): Field<BsonDocument, Child>
Refers to a root field of the document being analyzed.
Refers to a specific item in an array, by its index.
Refers to a specific item in a map, by its name.
Refers to a child item of a field of type BsonArray.
Refers to a child field of a field of type BsonDocument.
of¶
Refers to a Kotlin value within an aggregation value.
Refers to a field within an aggregation value.
Refers to a BsonType within an aggregation value.
Refers to a field within an aggregation value.
Refers to a Kotlin value within an aggregation value.
simplify¶
@LowLevelApi
abstract fun simplify(): BsonNode?
Returns a simplified (but equivalent) expression to the current expression.
toBson¶
@LowLevelApi
open fun toBson(): BsonDocument
Writes the result of simplifying to a new BsonDocument.
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.
Refers to a field child of the current field, with no compile-time safety.
unsafeCast¶
Overwrites the represented type of this value.
open fun <Root, NewType> KProperty1<Root, *>.unsafeCast(): Field<Root, NewType>
Overwrites the represented type of this field.
writeTo¶
@LowLevelApi
abstract override fun writeTo(writer: BsonFieldWriter)
Writes the result of simplifying this expression into writer.