of
open fun <Context : Any, Result> of(field: KProperty1<Context, Result>): Value<Context, Result>(source)
Refers to a field within an aggregation value.
Example
class Product(
val acceptanceDate: Instant,
val publishingDate: Instant,
)
val publishedBeforeAcceptance = products.find {
expr {
of(Product::publishingDate) lt of(Product::acceptanceDate)
}
}
Content copied to clipboard
Refers to a Kotlin value within an aggregation value.
Example
class Product(
val age: Int,
)
val publishedBeforeAcceptance = products.find {
expr {
of(Product::age) lt of(15)
}
}
Content copied to clipboard
Refers to a BsonType within an aggregation value.
Example
class Product(
val age: Int,
)
val publishedBeforeAcceptance = products.find {
expr {
of(Product::age).type eq of(BsonType.Int32)
}
}
Content copied to clipboard