AutoEncryptionOptions are mutated when connecting

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      import { MongoClient } from 'mongodb';
      
      const autoEncryption = {
        keyVaultNamespace: 'encryption.__keyVault',
        kmsProviders: { local: { key: 'A'.repeat(128) } }
      };
      const client = await MongoClient.connect(process.env.MONGODB_URI, {
        autoEncryption
      });
      console.log(autoEncryption.metadataClient); // <-- input options are being mutated
      await client.close();
      

      Not sure if this is a bug or not, but I thought I’d at least open a ticket.

              Assignee:
              Unassigned
              Reporter:
              Anna Henningsen
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: