How to query arrays?
I am getting this error whilst trying to make a query for array values.
could not find array type for data type text[]
here is my query:
Also, I converted my column from JSONB to Text[], does that make any difference?
4 Replies
You need to use .contains() or one of the other array operators on an array column. .in is for a single value text column. I think contains is what you want for this.
I tried contains, but now I get this error:
Possibly your tags array is not formatted correctly. My text array looks like this:
And
.contains('testchararray',['cat'])
works.
Yeah it works now, maybe it was formatted incorrect.