orderBy method

Query orderBy(
  1. JSAny fieldPath, [
  2. String directionStr
])

Creates and returns a new Query that's additionally sorted by the specified field, optionally in descending order instead of ascending.

This function returns a new (immutable) instance of the Query (rather than modify the existing instance) to impose the order.

@param fieldPath The field to sort by. @param directionStr Optional direction to sort by ('asc' or 'desc'). If not specified, order will be ascending. @return The created Query.

Implementation

external Query orderBy(
  JSAny fieldPath, [
  String directionStr,
]);