orderBy method

Query orderBy(
  1. String fieldPath,
  2. String directionStr
)

Implementation

Query orderBy(String fieldPath, String directionStr) {
  Validater.isFieldPath(fieldPath);
  Validater.isFieldOrder(directionStr);

  var newOrder = QueryOrder(field: fieldPath, direction: directionStr);
  List<QueryOrder> newOrders = List.from(_fieldOrders!);
  newOrders.add(newOrder);

  return Query(
    core: _core,
    coll: _coll,
    fieldFilters: _fieldFilters,
    fieldOrders: newOrders,
    queryOptions: _queryOptions,
  );
}