.overlaps()
const { data, error } = await supabase
.from('countries')
.select('name, id, main_exports')
.overlaps('main_exports', ['computers', 'minerals'])
Notes
.overlaps()
can work on array columns or range columns..overlaps('arraycol',["a","b"]) // You can use a javascript array for an array column
.overlaps('arraycol','{"a","b"}') // You can use a string with Postgres array {} for array column.
.overlaps('rangecol','(1,2]') // Use Postgres range syntax for range column.
.overlaps('rangecol',`(${arr}]`) // You can insert an array into a string.
Examples
With select()
const { data, error } = await supabase
.from('countries')
.select('name, id, main_exports')
.overlaps('main_exports', ['computers', 'minerals'])
With update()
let countries = await supabase
.from('countries')
.update({ name: 'Mordor' })
.overlaps('main_exports', ['computers', 'minerals'])
With delete()
const { data, error } = await supabase
.from('countries')
.delete()
.overlaps('main_exports', ['computers', 'minerals'])
With rpc()
// Only valid if the Postgres function returns a table type.
const { data, error } = await supabase
.rpc('echo_all_countries')
.overlaps('main_exports', ['computers', 'minerals'])