Skip to main content

.match()

Finds all rows whose columns match the specified query object.

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.match({name: 'Beijing', country_id: 156})

Parameters

  • queryrequiredRecord

    The object to filter with, with column names as keys mapped to their filter values.

Examples

With select()

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.match({name: 'Beijing', country_id: 156})

With update()

const { data, error } = await supabase
.from('cities')
.update({ name: 'Mordor' })
.match({name: 'Beijing', country_id: 156})

With delete()

const { data, error } = await supabase
.from('cities')
.delete()
.match({name: 'Beijing', country_id: 156})

With rpc()

// Only valid if the Postgres function returns a table type.
const { data, error } = await supabase
.rpc('echo_all_cities')
.match({name: 'Beijing', country_id: 156})