Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryor

or

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

Performs a logical OR operation on one or more expressions, and selects the documents that satisfy at least one of the expressions.

Example

class User(
    val name: String?,
    val age: Int,
)

collection.find {
    or {
        User::name eq "foo"
        User::name eq "bar"
        User::age eq 18
    }
}

External resources

See also