#StackBounty: #postgresql #spring-data-jpa #jsonb how to exclude JSON-fields in a custom jsonb query with CriteriaBuilder?

Bounty: 100

I am trying to construct a query with CriteriaBuilder for this json:

{
a: value1,
b: vsalue2,
c: value3,
d: value4
}

to match native query:

select field_with_json -c -d from table1 where field_with_json->>a = 'someValue' and field_with_json->>b = 'someValue'

I’m struggling to find the way of how to implement the '-c -d' part, that is, deleting certain key/value pairs from the end result in CriteriaBuilder. Is it possible at all?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.