Skip to content

Commit 1e342ff

Browse files
obtain CE from mongoose instance, not global driver config
1 parent 3777b5b commit 1e342ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/model.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const minimize = require('./helpers/minimize');
6969
const MongooseBulkSaveIncompleteError = require('./error/bulkSaveIncompleteError');
7070
const ObjectExpectedError = require('./error/objectExpected');
7171
const decorateBulkWriteResult = require('./helpers/model/decorateBulkWriteResult');
72-
const driver = require('./driver');
7372
const modelCollectionSymbol = Symbol('mongoose#Model#collection');
7473
const modelDbSymbol = Symbol('mongoose#Model#db');
7574
const modelSymbol = require('./helpers/symbols').modelSymbol;
@@ -4881,7 +4880,7 @@ Model.compile = function compile(name, schema, collectionName, connection, base)
48814880
};
48824881

48834882
Model.clientEncryption = function clientEncryption() {
4884-
const ClientEncryption = driver.get().ClientEncryption;
4883+
const ClientEncryption = this.base.driver.get().ClientEncryption;
48854884
if (!ClientEncryption) {
48864885
throw new Error('The mongodb driver must be used to obtain a ClientEncryption object.');
48874886
}

0 commit comments

Comments
 (0)