knex.js insert two rows code example
Example 1: knex insert multiple rows
let dataList = bookshelf.Collection.extend({
model: ModelName,
});
let multipleSaved = dataList.forge([...Your_listOfData]);
multipleSaved
.invokeThen("save")
.then(() => {...})
.catch(err=>{...})
Example 2: knex.js insert two rows
.insert([
{ name: 'Starsky' },
{ name: 'Hutch' }
])