Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryisOneOf

isOneOf

open fun <V> Field<T, V>.isOneOf(values: List<V>)

Selects documents for which this field is equal to one of the given values.

Example

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

collection.find {
    User::name.isOneOf(listOf("Alfred", "Arthur"))
}

External resources

See also

open fun <V> KProperty1<T, V>.isOneOf(values: List<V>)

Selects documents for which this field is equal to one of the given values.

Example

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

collection.find {
    User::name.isOneOf(listOf("Alfred", "Arthur"))
}

External resources

See also

open fun <V> Field<T, V>.isOneOf(vararg values: V)

Selects documents for which this field is equal to one of the given values.

Example

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

collection.find {
    User::name.isOneOf("Alfred", "Arthur")
}

External resources

See also

open fun <V> KProperty1<T, V>.isOneOf(vararg values: V)

Selects documents for which this field is equal to one of the given values.

Example

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

collection.find {
    User::name.isOneOf("Alfred", "Arthur")
}

External resources

See also