I'm using NodeJS and pg with a PostgreSQL database as backend. Running single queries with Client.query works fine.
However, I've got a challenge which I can solve in a simple and elegant way.
I would like to run:
UPDATE portfolios SET votes = $1 WHERE id = $2
from an array/list of:
[{votes: 5, id: 1}, {votes: 15, id: 1}, {votes: 25, id: 2}]
Can it be done in a single Client.query (or similar with pg), so I don't have to make a "for () { ... }"?