Skip to content

Commit

Permalink
pass BypassQueryAnalysis to CryptOptions in one line
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinAlbs committed May 23, 2022
1 parent d9a4b78 commit 4ff7f71
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,6 @@ func (c *Client) configureCryptFLE(opts *options.AutoEncryptionOptions) error {
cir = collInfoRetriever{client: c.metadataClientFLE}
}

var bypassQueryAnalysis bool
if opts.BypassQueryAnalysis != nil {
bypassQueryAnalysis = *opts.BypassQueryAnalysis
}

cryptOpts := &driver.CryptOptions{
CollInfoFn: cir.cryptCollInfo,
KeyFn: kr.cryptKeys,
Expand All @@ -833,7 +828,7 @@ func (c *Client) configureCryptFLE(opts *options.AutoEncryptionOptions) error {
TLSConfig: opts.TLSConfig,
BypassAutoEncryption: bypass,
SchemaMap: cryptSchemaMap,
BypassQueryAnalysis: bypassQueryAnalysis,
BypassQueryAnalysis: opts.BypassQueryAnalysis != nil && *opts.BypassQueryAnalysis,
EncryptedFieldsMap: cryptEncryptedFieldsMap,
}

Expand Down

0 comments on commit 4ff7f71

Please sign in to comment.