| 552 | }; |
| 553 | } |
| 554 | override newClient( |
| 555 | urlOrQueryOptions?: string | Record<string, any>, |
| 556 | serverOptions?: MongoClientOptions |
| 557 | ): MongoClient { |
| 558 | const options = serverOptions ?? {}; |
| 559 | |
| 560 | if (options.autoEncryption) { |
| 561 | const extraOptions: MongoClientOptions['autoEncryption']['extraOptions'] = { |
| 562 | ...options.autoEncryption.extraOptions, |
| 563 | ...this.encryptDefaultExtraOptions |
| 564 | }; |
| 565 | options.autoEncryption.extraOptions = extraOptions; |
| 566 | } |
| 567 | |
| 568 | return super.newClient(urlOrQueryOptions, options); |
| 569 | } |
| 570 | } |