Skip to main content

.like()

Finds all rows whose value in the stated column matches the supplied pattern (case sensitive).

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.like('name', '%la%')

Parameters#

  • columnrequiredobject

    The column to filter on.

  • patternrequiredstring

    The pattern to filter with.

Examples#

With select()#

const { data, error } = await supabase
.from('cities')
.select('name, country_id')
.like('name', '%la%')

With update()#

const { data, error } = await supabase
.from('cities')
.update({ name: 'Mordor' })
.like('name', '%la%')

With delete()#

const { data, error } = await supabase
.from('cities')
.delete()
.like('name', '%la%')

With rpc()#

// Only valid if the Postgres function returns a table type.
const { data, error } = await supabase
.rpc('echo_all_cities')
.like('name', '%la%')