Skip to content

Commit 02f2abd

Browse files
authored
Update delete_custom_events.js
fixed error "Finished with errors: TypeError: Class constructor ObjectId cannot be invoked without 'new'"
1 parent 1b9e449 commit 02f2abd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/scripts/expire-data/delete_custom_events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
2222
common.drillDb = drillDb;
2323
//GET APP
2424
try {
25-
const app = await countlyDb.collection("apps").findOne({_id: ObjectId(APP_ID)}, {_id: 1, name: 1});
25+
const app = await countlyDb.collection("apps").findOne({_id: new ObjectId(APP_ID)}, {_id: 1, name: 1});
2626
console.log("App:", app.name);
2727
//GET EVENTS
2828
let events = EVENTS;

0 commit comments

Comments
 (0)