Skip to content

Commit 7bde07f

Browse files
committed
fix: replace ObjectID with ObjectId due to mongodb depreciation
1 parent be56bd5 commit 7bde07f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { parse } = require("node-html-parser");
2-
const { ObjectID } = require('mongodb');
2+
const { ObjectId } = require('mongodb');
33

44
const renderedIgnoreEl = { INPUT: true, TEXTAREA: true, SELECT: true, LINK: true, IFRAME: true, "COCREATE-SELECT": true };
55

@@ -45,7 +45,7 @@ module.exports = async function renderHtml(orgDB, html) {
4545
record = dbCache.get(cacheKey)
4646
else {
4747
let collection = orgDB.collection(coll)
48-
record = await collection.findOne({"_id": new ObjectID(id)});
48+
record = await collection.findOne({"_id": new ObjectId(id)});
4949
dbCache.set(cacheKey, record)
5050
}
5151

0 commit comments

Comments
 (0)