Skip to main content
Version: v2 RC

match()

Match only rows where each column in query keys is equal to its associated value. Shorthand for multiple .eq()s.

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})