knex insert multiple rows

Solutions on MaxInterview for knex insert multiple rows by the best coders in the world

showing results for - "knex insert multiple rows"
Klara
03 Jun 2017
1let dataList = bookshelf.Collection.extend({
2	model: ModelName,
3});
4
5let multipleSaved = dataList.forge([...Your_listOfData]);
6
7multipleSaved
8.invokeThen("save")
9.then(() => {...})
10.catch(err=>{...})
Nicolás
31 Nov 2019
1  .insert([
2    { name: 'Starsky' },
3    { name: 'Hutch' }
4  ])
5