Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryand

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