👋 can anyone help me figure out how to filter a ...
# help
z
👋 can anyone help me figure out how to filter a query based on a value in a text array using the supabase-js library? In the code below, the
title
column is
text
and
tags
column is
text[]
. I would like to query them both using the
or
filter to see if a given
searchTerm
was there. Is this possible?
Copy code
js
const response = await supabaseClient
  .from('items')
  .select('*')
  .or(
    `title.ilike.%${searchTerm}%,tags.cs{${searchTerm}}`
  )
The above example does not work.. any ideas
g
I think you need a . after cs before {
z
like this
tags.cs.{${searchTerm}}
?
@User your suggestion works as I hoped. another case of not reading the docs properly 🤦‍♂️ thank you!