Skip to content
Advertisement

Tag: express

Express-Postgres fails to apply array filter: error: operator does not exist: integer[] && text[]

The same query works on the terminal. But for some reason I’m getting an error: pg.query is unable to process the expression path && Array[$1] using this: https://www.postgresql.org/docs/9.2/functions-array.html Answer This should work: Why? Short answer: type resolution. Long answer: Concluding from the error message that comments.comment_id is of type integer. Forming an array from it with ARRAY[comment_id] produces an integer

Advertisement