From eb2108352f3b73dc06df92124e5440cb76fa3ecb Mon Sep 17 00:00:00 2001 From: minsuk-kang <79878326+minsuk-kang@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:45:11 -0700 Subject: [PATCH] Call `create` in order instead of `insertMany` --- lib/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 015835e..4b18c17 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,9 +25,9 @@ var fixtures = module.exports = function(dataset, db, callback) { var model = db.model(tableName); if (model) { - model.insertMany(dataset[tableName], function(err) { - done(err, Array.prototype.slice.call(arguments, 1)); - }); + async.map(dataset[tableName], function(data, done) { + return model.create(data, done); + }, done); } else { done(new Error(tableName + ' does not exist')); }