await Game.bulkWrite(operations); // execute the bulk update operations.
getting the error;
{ message: 'Cannot create property \'$set\' on number \'0\'',
stack:
'TypeError: Cannot create property \'$set\' on number \'0\'\n at applyTimestampsToUpdate (E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\helpers\\update\\applyTimestampsToUpdate.js:40:16)\n at E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\helpers\\model\\castBulkWrite.js:50:11\n at E:\\Coding\\hypetrain\\node_modules\\mongoose\\node_modules\\async\\internal\\parallel.js:31:39\n at eachOfArrayLike (E:\\Coding\\hypetrain\\node_modules\\mongoose\\node_modules\\async\\eachOf.js:65:9)\n at exports.default (E:\\Coding\\hypetrain\\node_modules\\mongoose\\node_modules\\async\\eachOf.js:9:5)\n at _parallel (E:\\Coding\\hypetrain\\node_modules\\mongoose\\node_modules\\async\\internal\\parallel.js:30:5)\n at parallelLimit (E:\\Coding\\hypetrain\\node_modules\\mongoose\\node_modules\\async\\parallel.js:88:26)\n at utils.promiseOrCallback.cb (E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\model.js:3037:5)\n at Promise (E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\utils.js:262:5)\n at Promise._execute (E:\\Coding\\hypetrain\\node_modules\\bluebird\\js\\release\\debuggability.js:313:9)\n at Promise._resolveFromExecutor (E:\\Coding\\hypetrain\\node_modules\\bluebird\\js\\release\\promise.js:483:18)\n at new Promise (E:\\Coding\\hypetrain\\node_modules\\bluebird\\js\\release\\promise.js:79:10)\n at Object.promiseOrCallback (E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\utils.js:261:10)\n at Function.Model.bulkWrite (E:\\Coding\\hypetrain\\node_modules\\mongoose\\lib\\model.js:3036:16)\n at commitHistoricData (E:\\Coding\\hypetrain\\src\\tasks\\definitions\\services\\twitch\\update.js:149:16)' }
bug report, running mongoose 5.4.0.
What is the current behavior?
trying to run this bulkWrite operation;
running it with;
getting the error;
pointing here; https://github.com/Automattic/mongoose/blob/3cc4985bdb10e4ddcc9ed9947c027528030c33e5/lib/helpers/update/applyTimestampsToUpdate.js#L40
any ideas?