Skip to main content

.filter()

Finds all rows whose column satisfies the filter.

final res = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'in', '("Paris","Tokyo")')
.execute();

Notes#

  • .filter() expects you to use the raw PostgREST syntax for the filter values, so it should only be used as an escape hatch in case other filters don't work.

Examples#

With select()#

final res = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'in', '("Paris","Tokyo")')
.execute();

With update()#

final res = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.filter('name', 'in', '("Paris","Tokyo")')
.execute();

With delete()#

final res = await supabase
.from('cities')
.delete()
.filter('name', 'in', '("Paris","Tokyo")')
.execute();

With rpc()#

// Only valid if the Stored Procedure returns a table type.
final res = await supabase
.rpc('echo_all_cities')
.filter('name', 'in', '("Paris","Tokyo")')

Filter embedded resources#

final res = await supabase
.from('cities')
.select('name, countries ( name )')
.filter('countries.name', 'in', '("France","Japan")')
.execute();