How can I exact match jsonb arrays in postgresql (SELECT .. WHERE), whilst ignoring the order of the array?
id | data |
---|---|
1 | ["a", "b"] |
2 | ["b"] |
3 | ["a"] |
4 | ["c", "a", "b"] |
With the input of ["b", "a"]
I expect to receive id 1, and with the input of ["a", "b", "c"]
I expect to receive id 4. I have tried using the ?&
operator, although it would return id 1, 2, 4 if the input was ["b"]
.