ValueOperators¶
interface ValueOperators : FieldDsl
Supertype for all interface operators describing operators on aggregation values.
Most of the time, end-users will be using the subtype AggregationOperators instead of this interface.
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¶
div¶
Refers to field as a nested field of the current value.
Examples
class User(
val name: String,
)
class Data(
val users: List<User>,
val userNames: List<Int>,
)
data.aggregate()
.set {
Data::userNames set Data::users.map { it / User::name }
}
External resources
get¶
Refers to a child field of a field of type BsonDocument.
Example
open operator fun <Context : Any, Result> Value<Context, Collection<Result>>.get(index: Value<Context, Int>): Value<Context, Result>
open operator fun <Context : Any, Result> Value<Context, Collection<Result>>.get(index: Field<Context, Int>): Value<Context, Result>
of¶
Refers to a field within an aggregation value.
Example
Refers to a Kotlin value within an aggregation value.
Example
Refers to a BsonType within an aggregation value.
Example
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.
This method can be useful to bypass type checks.
Example
If a field has changed type over time, the DTO will use the newer type. However, you may still want to write a query using the old type: