Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQuerydoesNotExist

doesNotExist

open fun Field<T, *>.doesNotExist()

Matches documents that do not contain the specified field. Documents where the field if null are not matched.

Example

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

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

External resources

See also

open fun KProperty1<T, *>.doesNotExist()

Matches documents that do not contain the specified field. Documents where the field if null are not matched.

Example

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

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

External resources

See also