Skip to content

Commit 4c3cb49

Browse files
committed
fix: findOneAndUpdate
1 parent 78a8669 commit 4c3cb49

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/legacy_wrappers/collection.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,15 @@ module.exports.makeLegacyCollection = function (baseClass) {
194194
return maybeCallback(super.findOneAndReplace(filter, replacement, options), callback);
195195
}
196196

197-
findOneAndUpdate(filter, options, callback) {
197+
findOneAndUpdate(filter, update, options, callback) {
198198
callback =
199199
typeof callback === 'function'
200200
? callback
201201
: typeof options === 'function'
202202
? options
203-
: typeof filter === 'function'
204-
? filter
205203
: undefined;
206204
options = typeof options !== 'function' ? options : undefined;
207-
filter = typeof filter !== 'function' ? filter : undefined;
208-
return maybeCallback(super.findOneAndUpdate(filter, options), callback);
205+
return maybeCallback(super.findOneAndUpdate(filter, update, options), callback);
209206
}
210207

211208
indexExists(indexes, options, callback) {

0 commit comments

Comments
 (0)