Reputation: 1477
I am receiving an array of values from the client(CLIENT) in Node and would like to update all rows whose R_ID column matches my array.
Other than iterating over the array and updating each looked up element in turn, is there any way for me to do the following?
Any ideas?
Thank you
Upvotes: 0
Views: 1039
Reputation: 17710
Simply use ANY
and pass the array:
client.query("UPDATE some_table SET some_column=true WHERE id = ANY($1)",[array], function (err, result) ...
Upvotes: 2