From d374f141f395066b0f60c9a49ccdbdc408e78191 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Fri, 14 Aug 2020 11:19:29 -0400 Subject: [PATCH] fix: work around https://jira.mongodb.org/projects/NODE/issues/NODE-2741 Re: #9188 --- lib/helpers/model/castBulkWrite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers/model/castBulkWrite.js b/lib/helpers/model/castBulkWrite.js index 0455562f461..8e47afce706 100644 --- a/lib/helpers/model/castBulkWrite.js +++ b/lib/helpers/model/castBulkWrite.js @@ -71,7 +71,6 @@ module.exports = function castBulkWrite(originalModel, op, options) { overwrite: false, upsert: op['updateOne'].upsert }); - } catch (error) { return callback(error, null); } @@ -152,6 +151,7 @@ module.exports = function castBulkWrite(originalModel, op, options) { if (error) { return callback(error, null); } + op['replaceOne']['replacement'] = op['replaceOne']['replacement'].toBSON(); callback(null); }); };