and

abstract fun and(block: FilterQuery<T>.() -> Unit)(source)

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

Logical OR operation.

Logical NOR operation.