@@ -25,7 +25,7 @@ const setPopulatedVirtualValue = require('./helpers/populate/setPopulatedVirtual
2525const setupTimestamps = require ( './helpers/timestamps/setupTimestamps' ) ;
2626const utils = require ( './utils' ) ;
2727const validateRef = require ( './helpers/populate/validateRef' ) ;
28- const { inferBSONType } = require ( './encryption_utils ' ) ;
28+ const { inferBSONType } = require ( './encryptionUtils ' ) ;
2929
3030const hasNumericSubpathRegex = / \. \d + ( \. | $ ) / ;
3131
@@ -131,7 +131,6 @@ function Schema(obj, options) {
131131 this . $id = ++ id ;
132132 this . mapPaths = [ ] ;
133133 this . encryptedFields = { } ;
134- this . _encryptionType = options ?. encryptionType ;
135134
136135 this . s = {
137136 hooks : new Kareem ( )
@@ -523,7 +522,7 @@ Schema.prototype.pick = function(paths, options) {
523522 }
524523
525524 if ( ! this . _hasEncryptedFields ( ) ) {
526- newSchema . _encryptionType = null ;
525+ newSchema . options . encryptionType = null ;
527526 }
528527
529528 return newSchema ;
@@ -695,9 +694,9 @@ Schema.prototype._defaultToObjectOptions = function(json) {
695694 */
696695Schema . prototype . encryptionType = function encryptionType ( encryptionType ) {
697696 if ( typeof encryptionType === 'string' || encryptionType === null ) {
698- this . _encryptionType = encryptionType ;
697+ this . options . encryptionType = encryptionType ;
699698 } else {
700- return this . _encryptionType ;
699+ return this . options . encryptionType ;
701700 }
702701} ;
703702
0 commit comments