JavaScript: Limit the number of rows returned

Limit the query result by count.

Parameters

Examples

With `select()`

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

On a referenced table

const \{ data, error \} = await supabase
  .from('countries')
  .select(`
    name,
    cities (
      name
    )
  `)
  .limit(1, \{ referencedTable: 'cities' \})