Is there a way to negate the ?& operator in Postgres? The operators table in the postgres docs says that ?&is equivelent to "Do all of these key/element string exist?"
What I want to do is return rows based on whether all keys in an array do not exist. So something like
SELECT * FROM mytable WHERE NEGATE_THIS(jsoncolumn ?& ['v1', 'v2'])
I can't see a specific operator in the documents, is there a way to do this?
How about (assuming you want all rows where none of the keys exist)
WHERE NOT (jsoncolumn ?| ['v1', 'v2'])
?| is "Do any of these key/element strings exist?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With