Skip to content

Commit

Permalink
Add comment about mongodb v6.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Dec 5, 2024
1 parent 685c49b commit 4ce28be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/sinks/MongoDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ export class MongoDB implements Wrapper {
.addPackage("mongodb")
.withVersion("^4.0.0 || ^5.0.0 || ^6.0.0")
.onRequire((exports, pkgInfo) => {
// From mongodb v6.10.0, the Collection is undefined
// It's defined like:
// exports.Collection = void 0;
// const collection_1 = require("./collection");
// Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return collection_1.Collection; } });
// So we need to wait for the next tick to wrap the Collection
process.nextTick(() => {
this.wrapCollection(exports, pkgInfo);
});
Expand Down

0 comments on commit 4ce28be

Please sign in to comment.