Skip to content

Commit

Permalink
fix: patch findAndModify updateOrCreate to apply context.bind
Browse files Browse the repository at this point in the history
additional fix for PR loopbackio#275
  • Loading branch information
Tom Kirkpatrick committed Jul 13, 2017
1 parent a5c83f8 commit 37c1748
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -620,7 +620,7 @@ MongoDB.prototype.updateOrCreate = function updateOrCreate(model, data, options,
}

callback && callback(err, object, info);
});
}));
};

/**
Expand Down

0 comments on commit 37c1748

Please sign in to comment.