exists

open fun Field<T, *>.exists()(source)
open fun KProperty1<T, *>.exists()(source)

Matches documents that contain the specified field, including values where the field value is null.

Example

class User(
val name: String?,
val age: Int,
)

collection.find {
User::age.exists()
}

External resources

See also

Identical, but does not match elements where the field is null.