elemMatch

@JvmName(name = "elemMatchProjExt")
infix fun <T> KProperty<T>.elemMatch(filter: Bson): Bson

Creates a projection that includes for the given property only the first element of the array value of that field that matches the given query filter.

Return

the projection @mongodb.driver.manual reference/operator/projection/elemMatch elemMatch

Parameters

filter

the filter to apply


fun <T> elemMatch(property: KProperty<T>, filter: Bson): Bson

Creates a projection that includes for the given property only the first element of the array value of that field that matches the given query filter.

Return

the projection @mongodb.driver.manual reference/operator/projection/elemMatch elemMatch

Parameters

property

the data class property

filter

the filter to apply


val <T> KProperty<T>.elemMatch: Bson

Creates a projection that includes for the given property only the first element of an array that matches the query filter. This is referred to as the positional $ operator.

Return

the projection @mongodb.driver.manual reference/operator/projection/positional/#projection Project the first matching element ($ operator)