Skip to main content
Module

x/denodb_esgi/mod.ts>Model.orderBy

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Latest
method Model.orderBy
import { Model } from "https://deno.land/x/denodb_esgi@1.0.15.1/mod.ts";

Order query results based on a field name and an optional direction.

await Flight.orderBy("departure").all();

await Flight.orderBy("departure", "desc").all();

await Flight.orderBy({ departure: "desc", destination: "asc" }).all();

Type Parameters

T extends ModelSchema

Parameters

this: T
fieldOrFields: string | OrderByClauses
optional
orderDirection: OrderDirection = [UNSUPPORTED]