node.js - how to update data using knex() in loopback? -




i trying code update data in loopback not work please give right solution if trying update data not updated please tell me answer how code work:

return new promise(function(resolve, reject) {       //builds sql query       var query = knex('customer_information').insert({         customer_id: data.customer_id ? data.customer_id : null,         company_name: data.company_name ? data.company_name : null,         country: data.country ? data.country : null,         address1: data.address1 ? data.address1 : null,         address2: data.address2 ? data.address2 : null,         city: data.city ? data.city : null,         state: data.state ? data.state : null,         postalcode: data.postalcode ? data.postalcode : null,         phonenumber: data.phonenumber ? data.phonenumber : null,         customertype: data.customertype ? data.customertype : null,       });       console.log(query);        datasource.connector.query(query.tostring(), null, function(err, response) {         console.log(response);         console.log('resssss: ' + json.stringify(response));         //console.log('resssss: ' + json.stringify(response[0].customer_id));         if (err) reject(err);         else {           resolve(true);         }       });     }); 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -