Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryisNotOneOf

isNotOneOf

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

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

This operator will also select documents for which the field doesn't exist.

Example

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

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

External resources

See also

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

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

This operator will also select documents for which the field doesn't exist.

Example

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

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

External resources

See also

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

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

This operator will also select documents for which the field doesn't exist.

Example

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

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

External resources

See also

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

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

This operator will also select documents for which the field doesn't exist.

Example

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

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

External resources

See also