Skip to content

Commit 0ff1224

Browse files
committed
fix: fixed NativeConnection vs. MongooseConnection usage due to this.doClose not being exposed
1 parent 7b74b97 commit 0ff1224

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const mongoose = require('mongoose');
22
const mergeOptions = require('merge-options');
33

4-
const Connection = require('mongoose/lib/connection');
4+
//
5+
// NOTE: we have to use NativeConnection instead of MongooseConnection due to doClose not being exposed
6+
//
7+
const Connection = require('mongoose/lib/drivers/node-mongodb-native/connection');
58

69
function log(fn, message, hideMeta) {
710
if (hideMeta) fn(message, { [hideMeta]: true });

0 commit comments

Comments
 (0)