elemMatchProj

fun <T> KProperty<T>.elemMatchProj(): 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


fun <T> KProperty<T>.elemMatchProj(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

Parameters

filter

the filter to apply