I have a table with a JSONB column which stores some structure as below:
[{
"id": "id1",
"value": "value1"
},
{
"id": "id2",
"value": "value2"
},
{
"id": "id3",
"value": "value3"
}]
I want to query the jsonb field by providing more than one values for the "value" field like in a OR condition.
Currently i have the query running for a single value in the where clause and i have to run it in a loop from the persistence layer and then merge the results. This is what i am using:
select *
from table1
where lower(column1::text)::jsonb @> cast(lower('[{"value":"value1"}]'::text) AS JSONB)
Is there a way i can pass multiple values and the result will be an OR for more than one values passed.