MongoDB request DSL • opensavvy.ktmongo.dsl.query • FilterQuery • and
and¶
abstract fun and(block: FilterQuery<T>.() -> Unit)
Performs a logical AND
operation on one or more expressions, and selects the documents that satisfy all the expressions.
Example¶
class User(
val name: String?,
val age: Int,
)
collection.findOne {
and {
User::name eq "foo"
User::age eq 18
}
}
External resources¶
See also¶
-
FilterQuery.or
LogicalOR
operation. -
FilterQuery.nor
LogicalNOR
operation.