diff --git a/lib/mongodb.js b/lib/mongodb.js index 060833326..4ed1b0437 100644 --- a/lib/mongodb.js +++ b/lib/mongodb.js @@ -598,7 +598,7 @@ MongoDB.prototype.updateOrCreate = function updateOrCreate(model, data, options, _id: oid, }, [ ['_id', 'asc'], - ], data, { upsert: true, new: true }, function(err, result) { + ], data, { upsert: true, new: true }, patchWithContext(function(err, result) { if (self.debug) { debug('updateOrCreate.callback', model, id, err, result); } @@ -620,7 +620,7 @@ MongoDB.prototype.updateOrCreate = function updateOrCreate(model, data, options, } callback && callback(err, object, info); - }); + })); }; /**