Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryisIn

isIn

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

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

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

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

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

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

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

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

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

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

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

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