Monday, 28 May 2018

node-querybuilder returns error message despite providing data

I am using node-querybuilder to update data in batch.

This is what i am doing.

const key = 'tripId';
const where = {'tripId =' : id}

const dataset= 
[   { studentId: 43 }, 
    { studentId: 42 } 
];


db.queryBuilder.update_batch('trip_students_booking', dataset, key, where, (err, res) => {
    if (err) return console.error(err);

});

In response i am getting this error message from node-querybuilder

Error: update_batch(): You must provide some data to batch update!



from node-querybuilder returns error message despite providing data

No comments:

Post a Comment