MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.operators • ValueOperators • of
of
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)
}
}
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)
}
}
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)
}
}
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)
}
}