bottom

fun <OutExpression> bottom(property: KProperty<*>, sortBy: Bson, outExpression: OutExpression): BsonField

Returns a combination of a computed field and an accumulator that produces a value of the given {@code outExpression} computed for the bottom element within a group sorted according to the provided {@code sortBy} specification.

Return

The requested {@link BsonField}. @mongodb.driver.manual reference/operator/aggregation/bottom/ $bottom @mongodb.server.release 5.2

Parameters

property

The data class property computed by the accumulator.

sortBy

The {@linkplain Sorts sort specification}. The syntax is identical to the one expected by {@link Aggregates#sort(Bson)}.

outExpression

The output expression.

The type of the output expression.