Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQuerycontainsAll

containsAll

abstract infix fun <V> Field<T, Collection<V>>.containsAll(values: Collection<V>)

Selects documents where the value of a field is an array that contains all the specified values.

Example

class User(
    val grades: List<Int>
)

collection.find {
    User::grades containsAll listOf(2, 3, 7)
}

External resources

open infix fun <V> KProperty1<T, Collection<V>>.containsAll(values: Collection<V>)

Selects documents where the value of a field is an array that contains all the specified values.

Example

class User(
    val grades: List<Int>
)

collection.find {
    User::grades containsAll listOf(2, 3, 7)
}

External resources