Match the filter
Finds all rows whose column
satisfies the filter.
.filter()
expects you to use the raw PostgREST syntax for the filter names and values, so it should only be used as an escape hatch in case other filters don't work.1 .filter('arraycol','cs','{"a","b"}') // Use Postgres array {} for array column and 'cs' for contains. 2 .filter('rangecol','cs','(1,2]') // Use Postgres range syntax for range column. 3 .filter('id','in','(6,7)') // Use Postgres list () for in filter. 4 .filter('id','in',`(${arr})`) // You can insert a javascript array.
Parameters
column
REQUIRED
objectThe column to filter on.
operator
REQUIRED
FilterOperatorThe operator to filter with.
value
REQUIRED
anyThe value to filter with.
const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.filter('name', 'in', '("Paris","Tokyo")')