invoke

abstract operator fun <V> Field<T, V>.invoke(block: FilterQueryPredicate<V>.() -> Unit)(source)
open operator fun <V> KProperty1<T, V>.invoke(block: FilterQueryPredicate<V>.() -> Unit)(source)

Targets a single field to execute a targeted predicate.

Example

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

collection.find {
User::name {
eq("foo")
}
}

Note that many operators available this way have a convenience function directly in this class to shorten this. For this example, see eq:

collection.find {
User::name eq "foo"
}