Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryisNull

isNull

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

Selects documents for which the field is null.

Example

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

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

External resources

See also

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

Selects documents for which the field is null.

Example

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

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

External resources

See also