jvm MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.stages • HasSort • sort sort¶ open fun sort(block: SortOptionDsl<Document>.() -> Unit): Pipeline<Document> Specifies in which order elements should be sorted. Example¶ collection.aggregate() .sort { ascending(User::age) } .limit(15) .toList() External resources¶ Official documentation