isIn

open infix fun <V : Comparable<V>> Field<T, V?>.isIn(range: ClosedRange<V>)(source)
open infix fun <V : Comparable<V>> KProperty1<T, V?>.isIn(range: ClosedRange<V>)(source)
open infix fun <V : Comparable<V>, R : ClosedRange<V>, OpenEndRange<V>> Field<T, V?>.isIn(range: R)(source)
open infix fun <V : Comparable<V>, R : ClosedRange<V>, OpenEndRange<V>> KProperty1<T, V?>.isIn(range: R)(source)

Selects documents in which this field has a value included in range.

Example

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

collection.find {
User::age isIn (25..50)
}

See also

Only specify the lower bound.

Only specify the higher bound.


open infix fun <V : Comparable<V>> Field<T, V?>.isIn(range: OpenEndRange<V>)(source)
open infix fun <V : Comparable<V>> KProperty1<T, V?>.isIn(range: OpenEndRange<V>)(source)

Selects documents in which this field has a value included in range.

Example

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

collection.find {
User::age isIn (25..<50)
}

See also

Only specify the lower bound.

Only specify the higher bound.