pull

abstract fun <V> Field<T, Collection<V>>.pull(value: V, type: KType)(source)
infix inline fun <V> Field<T, Collection<V>>.pull(value: V)(source)
infix inline fun <V> KProperty1<T, Collection<V>>.pull(value: V)(source)

Removes all instances of value from the specified array.

Example

class User(
val name: String,
val tests: List<Int>,
)

users.updateOne(
filter = { User::name eq "Paul" },
update = {
User::tests pull 10
}
)

External resources


abstract fun <V> Field<T, Collection<V>>.pull(predicate: FilterQuery<V>.() -> Unit, type: KType)(source)
infix inline fun <V> Field<T, Collection<V>>.pull(noinline predicate: FilterQuery<V>.() -> Unit)(source)
infix inline fun <V> KProperty1<T, Collection<V>>.pull(noinline predicate: FilterQuery<V>.() -> Unit)(source)

Removes all items of an array that match predicate.

To select items based on their own intrinsic value (e.g. whether the item is greater than some value), see pullValues.

Example

class User(
val name: String,
val tests: List<Grade>,
)

class Grade(
val name: String,
val score: Int,
)

users.updateOne(
filter = { User::name eq "Paul" },
update = {
User::tests pull { Gradle::score lte 10 }
}
)

External resources