exists

fun <T> KProperty<T>.exists(): Bson

Creates a filter that matches all documents that contain the given property.

Return

the filter


infix fun <T> KProperty<T>.exists(exists: Boolean): Bson

Creates a filter that matches all documents that either contain or do not contain the given property, depending on the value of the exists parameter.

Return

the filter

Parameters

exists

true to check for existence, false to check for absence