isEmpty

open fun Field<T, Collection<*>>.isEmpty()(source)

Matches documents in which an array is empty or absent.

Example

Return all users that have no grades (either an empty array, or the grades field is absent):

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

collection.find {
User::grades.isEmpty()
}

See also