sql - Update Postgres rows using an array from client using Node.JS -


i receiving array of values client(client) in node , update rows r_id column matches array.

other iterating on array , updating each looked element in turn, there way me following?

  1. select records r_id column matches value client
  2. update records in column bool false true

any ideas?

thank you

simply use any , pass array:

client.query("update some_table set some_column=true id = any($1)",[array], function (err, result) ... 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -