diff --git a/lib/core/wireprotocol/command.js b/lib/core/wireprotocol/command.js index 09ea788311..bb7637ed8a 100644 --- a/lib/core/wireprotocol/command.js +++ b/lib/core/wireprotocol/command.js @@ -145,7 +145,9 @@ function supportsOpMsg(topologyOrServer) { } function _cryptCommand(server, ns, cmd, options, callback) { - const shouldBypassAutoEncryption = !!server.s.options.bypassAutoEncryption; + const shouldBypassAutoEncryption = !!( + server.s.options.autoEncryption && server.s.options.autoEncryption.bypassAutoEncryption + ); const autoEncrypter = server.autoEncrypter; function commandResponseHandler(err, response) { if (err || response == null) {