Sequelize如何插入更新多行?

我尝试用Sequelize在我的数据库中插入多行,但由于违反了一些约束,for循环卡住了。

let dataset = [ ["2016-01-01","987"], ["2016-01-02","987"], ["2016-01-03","987"], ["2016-01-04","987"], ["2016-01-05","987"], ["2016-01-06","987"], ["2016-01-07","987"], ... ]; for(let row of dataset) { model.findOrCreate({ where: {date_prc: row[0]}, defaults: {value: row[1]} }); } 

当我查看SQL日志时,它正在检查date是否已经插入,如果没有,它正在尝试插入该行。 但是,在某些情况下,而不是插入缺less的date行,它插入下一个date。

例如在我看到的日志中:

  select 2016-01-03 // this one is missing select 2016-01-04 // this one is not missing insert 2016-01-04 // it is inserting 2016-01-04 instead of 2016-01-03