sort

Sort the documents that match the query provided in the preceding find-like function call.

Documents that are missing the field to sort by will appear at the beginning of the results when sorting in ascending order.

Return

a DittoWriteTransactionPendingCursorOperation that you can chain further function calls and then either get the matching documents immediately or get updates about them over time.

Parameters

query

name or path of the field to sort by.

direction

specify whether you want the sorting order to be ascending or descending.