limit()
Limits the result with the specified count
.
const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.limit(1)
Parameters
countrequired
number
The maximum no. of rows to limit to.
__namedParametersrequired
object
No description provided.
foreignTablerequired
undefined
|string
The foreign table to use (for foreign columns).
Properties
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' })