Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryPredicateexists

exists

abstract fun exists()

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::name {
        exists()
    }
}

External resources

See also