Skip to content

Commit

Permalink
Merge pull request #5924 from Countly/SER-2276
Browse files Browse the repository at this point in the history
MongoDb findOneAndDelete Return Value
  • Loading branch information
ArtursKadikis authored Jan 16, 2025
2 parents 0cf59c7 + fa65e58 commit cf99b92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion plugins/pluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,14 @@ var pluginManager = function pluginManager() {
}
logDbRead.d(name + " " + collection + " %j %j" + at, query, options);
logDbRead.d("From connection %j", countlyDb._cly_debug);
return handlePromiseErrors(this["_" + name](query, options), e, copyArguments(arguments, name), logForReads(callback, e, copyArguments(arguments, name)));
if (name === "findOneAndDelete" && !options.remove) {
return handlePromiseErrors(this["_" + name](query, options).then(result => ({ value: result })),
e, copyArguments(arguments, name), logForReads(callback, e, copyArguments(arguments, name))
);
}
else {
return handlePromiseErrors(this["_" + name](query, options), e, copyArguments(arguments, name), logForReads(callback, e, copyArguments(arguments, name)));
}
};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global countlyCommon, app, jQuery,_ $*/
/*global countlyCommon, app, jQuery $*/
(function(starRatingPlugin) {
var _pv = {};
// feedbackd datas
Expand Down

0 comments on commit cf99b92

Please sign in to comment.