.filter()

Finds all rows whose column satisfies the filter.

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'eq', 'Paris')

Parameters

  • columnrequiredobject

    The column to filter on.

  • operatorrequiredFilterOperator

    The operator to filter with.

  • valuerequiredany

    The value to filter with.

Examples

With select()

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'eq', 'Paris')

With update()

const { data, error } = await supabase
.from('cities')
.update({ name: 'Mordor' })
.filter('name', 'eq', 'Paris')

With delete()

const { data, error } = await supabase
.from('cities')
.delete()
.filter('name', 'eq', 'Paris')

With rpc()

// Only valid if the Stored Procedure returns a table type.
const { data, error } = await supabase
.rpc('echo_all_cities')
.filter('name', 'eq', 'Paris')

Filter embedded resources

export const getFilterJsEmbedded = `
const { data, error } = await supabase
.from('cities')
.select('name, countries ( name )')
.filter('countries.name', 'eq', 'France')
`.trim()