Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryPredicatedoesNotExist

doesNotExist

abstract fun doesNotExist()

Matches documents that do not contain the specified field. Documents where the field if null are counted as existing.

Example

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

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

External resources

See also