order()

Orders the result with the specified column.

const { data, error } = await supabase
.from('cities')
.select('name', 'country_id')
.order('id')

Parameters

  • columnrequiredobject

    The column to order on.

  • __namedParametersrequiredobject

    No description provided.

      Properties
    • ascendingrequiredboolean

      If true, the result will be in ascending order.

    • foreignTablerequired|

      The foreign table to use (if column is a foreign column).

    • nullsFirstrequiredboolean

      If true, nulls appear first.

Examples

With select()

const { data, error } = await supabase
.from('cities')
.select('name', 'country_id')
.order('id')

With embedded resources

const { data, error } = await supabase
.from('countries')
.select('name, cities(name)')
.eq('name', 'United States')
.order('cities.name')