SHARE
TWEET

Untitled

a guest Jun 17th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const knexDb = knex({ client: 'pg', connection: {
  2.     host : '127.0.0.1',
  3.     user : process.env.DB_USER,
  4.     password : process.env.DB_PASSWORD,
  5.     database : process.env.DB_DATABASE,
  6.     port: process.env.DB_PORT
  7.   }});
  8.  
  9. arrayWith5ThousandObj.map(data => {
  10.     knexDb('users').where({
  11.       user: data.user,
  12.     })
  13.     .update({
  14.       product: data.product
  15.     })
  16.     .catch(err => console.error('update user products', err))
  17. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top