Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsTypeValueOperators

TypeValueOperators

Operators to interact with type information.

To learn more about aggregation operators, view AggregationOperators.

Inheritors

Properties

context

abstract val context: 

field

Converts a Kotlin property into a Field.

isArray

open val <R : Any> Value<R, *>.isArray: Value<R, Boolean>

Determines if this value is an array.

isNumber

open val <R : Any> Value<R, *>.isNumber: Value<R, Boolean>

Determines if this value is a number.

type

open val <R : Any> Value<R, *>.type: Value<R, >

Gets the BsonType of the current value.

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.

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.

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.

toBoolean

open fun <R : Any> Value<R, *>.toBoolean(): Value<R, Boolean>

Converts this value to a BsonType.Boolean.

toDouble

open fun <R : Any> Value<R, *>.toDouble(): Value<R, Double>

Converts this value to a BsonType.Double.

toInstant

open fun <R : Any> Value<R, *>.toInstant(): Value<R, >

Converts this value to an Instant (BsonType.Datetime).

toInt

open fun <R : Any> Value<R, *>.toInt(): Value<R, Int>

Converts this value to an Int (BsonType.Int32).

toLong

open fun <R : Any> Value<R, *>.toLong(): Value<R, Long>

Converts this value to an Long (BsonType.Int64).

toObjectId

open fun <R : Any> Value<R, *>.toObjectId(): Value<R, >

Converts this value to an ObjectId.

toText

open fun <R : Any> Value<R, *>.toText(): Value<R, String>

Converts this value to a String.

toUuid

open fun <R : Any> Value<R, *>.toUuid(): Value<R, >

Converts a string value to a Uuid (BsonType.BinaryData).