Skip to content
Advertisement

Tag: jsonb

Query for array values within jsonb column

I have a jsonb column called chores in my work table with data looking something like this: [{“task”: “feed_dog”, “value”: “Daily”},{“task”: “mop_floor”, “value”: “Weekly”] There could be zero to dozens of tasks in the chores array for each user. How can I query by task name? For example, pull all records where at least one task is feed_dog. SELECT chores->>’task’

Advertisement