Type Alias OrderBy<T>

OrderBy<T>: keyof T | {
    column: keyof T;
    descending: boolean;
    nullLast?: boolean;
}

Type Parameters

  • T extends object

    The type of the object to query. This is generally not needed to be specified, but can be useful if you're calling this yourself instead of through a Model.

    {
    // Any of these are valid
    orderBy: 'id',
    orderBy: ['id', 'name'],
    orderBy: { column: 'id', descending: true, nullLast: true },
    orderBy: [{ column: 'id', descending: true, nullLast: true }, { column: 'name', descending: false, nullLast: false }],
    }