isMapEmpty

open fun Field<T, Map<String, *>>.isMapEmpty()(source)

Matches documents in which a map is empty or absent.

Example

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

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

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

See also