kmongo / org.litote.kmongo / kotlin.reflect.KProperty / count

count

val KProperty<*>.count: BsonField (source)

Gets a field name for a $group operation representing the count of the values of the given expression when applied to all members of the group.

Parameters

expression - the expression

Return
the field

fun <T> KProperty<T>.count(): Bson (source)

Creates a $count pipeline stage using the named field to store the result

Parameters

field - the field in which to store the count

Return
the $count pipeline stage

Mongodb
.driver.manual reference/operator/aggregation/count/ $count