Skip to main content

limit()

Limits the result with the specified count.

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

Parameters

  • countrequirednumber

    The maximum no. of rows to limit to.

  • __namedParametersrequiredobject

    No description provided.

      Properties
    • foreignTablerequiredundefined | string

      The foreign table to use (for foreign columns).

Examples

With select()

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

With embedded resources

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