I'm looking for a way to query PostgreSQL JSONB array field with kind of = clause.
Let's assume I have a table
CREATE TABLE events(
id integer,
tags jsonb,
PRIMARY KEY(id)
);
tags having values like ['Google', 'Hello World', 'Ruby']
I have gone through Stackover Flow and done similar things.
And the SQL formed is like
SELECT "events".* FROM "events" WHERE ("events"."tags" @> '{google}') ORDER BY "business_events"."id" desc;
By running this, I'm getting this error =>
ERROR: invalid input syntax for type json
LINE 1: ...siness_events" WHERE ("business_events"."tags" @> '{google}'...
^
DETAIL: Token "google" is invalid.
CONTEXT: JSON data, line 1: {google...
Any Idea ?