© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
14 replies
Nin

Unable to filter on jsonb array column

Hi! I'm trying to do a select query on my Supabase database where I filter on a color which is contained in a jsonb array column. However, it's currently moaning about me not sending the array value correctly and I cannot seem to figure out what I'm doing wrong.

.from('source')
                .select(
                  'name, uuid, image, bio, type, colors, collector_number',
                )
                .contains('colors', ['Orange'])
.from('source')
                .select(
                  'name, uuid, image, bio, type, colors, collector_number',
                )
                .contains('colors', ['Orange'])


Error message:

{"code":"22P02","details":"Token \"Orange\" is invalid.","hint":null,"message":"invalid input syntax for type json"}
{"code":"22P02","details":"Token \"Orange\" is invalid.","hint":null,"message":"invalid input syntax for type json"}
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to query & filter depending on if a key exists in a jsonb column?
SupabaseSSupabase / help-and-questions
3y ago
Trying to alter a jsonb column's default type to be empty jsonb.
SupabaseSSupabase / help-and-questions
4y ago
Filter for 'contains any' for an array column, searching by an array
SupabaseSSupabase / help-and-questions
4y ago
Filter efficiently using jsonb with sdk
SupabaseSSupabase / help-and-questions
4mo ago