Skip to main content
Version: v1-dev

.not()

Finds all rows which doesn't satisfy the filter.

final data = await supabase
.from('cities')
.select('name, country_id')
.not('name', 'eq', 'Paris');

Notes

  • .not() expects you to use the raw PostgREST syntax for the filter names and values.

    .not('name','eq','Paris')
    .not('arraycol','cs','{"a","b"}') // Use Postgres array {} for array column and 'cs' for contains.
    .not('rangecol','cs','(1,2]') // Use Postgres range syntax for range column.
    .not('id','in','(6,7)') // Use Postgres list () and 'in' for in_ filter.
    .not('id','in','(${mylist.join(',')})') // You can insert a Dart list array.

Examples

With select()

final data = await supabase
.from('cities')
.select('name, country_id')
.not('name', 'eq', 'Paris');

With update()

final data = await supabase
.from('cities')
.update({ 'name': 'Mordor' })
.not('name', 'eq', 'Paris');

With delete()

final data = await supabase
.from('cities')
.delete()
.not('name', 'eq', 'Paris');

With rpc()

// Only valid if the Stored Procedure returns a table type.
final data = await supabase
.rpc('echo_all_cities)
.not('name', 'eq', 'Paris');