Skip to content

Commit

Permalink
Update to support newer versions of mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
fhawkes committed Sep 27, 2024
1 parent 0a0cfae commit 16c92dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/controllers/agendash.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function (agenda, options) {

if (options.query && options.property) {
if (options.isObjectId) {
preMatch[options.property] = ObjectId(options.query);
preMatch[options.property] = new ObjectId(options.query);
} else if (/^\d+$/.test(options.query)) {
preMatch[options.property] = Number.parseInt(options.query, 10);
} else {
Expand Down Expand Up @@ -349,7 +349,7 @@ module.exports = function (agenda, options) {
const jobs = await collection
.find({
_id: {
$in: jobIds.map((jobId) => ObjectId(jobId)),
$in: jobIds.map((jobId) => new ObjectId(jobId)),
},
})
.toArray();
Expand All @@ -372,7 +372,7 @@ module.exports = function (agenda, options) {
}

return agenda.cancel({
_id: { $in: jobIds.map((jobId) => ObjectId(jobId)) },
_id: { $in: jobIds.map((jobId) => new ObjectId(jobId)) },
});
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@soundbeef/agendash",
"version": "3.0.0",
"version": "3.1.0",
"description": "A modern dashboard for Agenda.js with Pagination and Search capabilities",
"main": "app.js",
"bin": "bin/agendash-standalone.js",
Expand Down

0 comments on commit 16c92dd

Please sign in to comment.