Skip to content

Commit 37c1748

Browse files
author
Tom Kirkpatrick
committed
fix: patch findAndModify updateOrCreate to apply context.bind
additional fix for PR loopbackio#275
1 parent a5c83f8 commit 37c1748

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/mongodb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ MongoDB.prototype.updateOrCreate = function updateOrCreate(model, data, options,
598598
_id: oid,
599599
}, [
600600
['_id', 'asc'],
601-
], data, { upsert: true, new: true }, function(err, result) {
601+
], data, { upsert: true, new: true }, patchWithContext(function(err, result) {
602602
if (self.debug) {
603603
debug('updateOrCreate.callback', model, id, err, result);
604604
}
@@ -620,7 +620,7 @@ MongoDB.prototype.updateOrCreate = function updateOrCreate(model, data, options,
620620
}
621621

622622
callback && callback(err, object, info);
623-
});
623+
}));
624624
};
625625

626626
/**

0 commit comments

Comments
 (0)