Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.queryFilterQueryisNotNull

isNotNull

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

Selects documents for which the field is not null.

Example

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

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

External resources

See also

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

Selects documents for which the field is not null.

Example

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

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

External resources

See also