Docs HomeMongoDB Manual

MongoClient Options for Queryable Encryption可查询加密的MongoClient选项

Queryable Encryption with equality queries is generally available (GA) in MongoDB 7.0 and later. 具有相等查询的可查询加密在MongoDB 7.0及更高版本中通常可用(GA)。The Queryable Encryption Public Preview, released in version 6.0, is no longer supported. Data encrypted using the Public Preview is incompatible with the feature release. 不再支持6.0版本中发布的“可查询加密预览”。使用公共预览加密的数据与功能版本不兼容。For more information, see Compatibility Changes in MongoDB 7.0.有关更多信息,请参阅MongoDB 7.0中的兼容性更改

Overview概述

On this page, you can learn about the Queryable Encryption-specific configuration options for MongoClient instances.在这个页面上,您可以了解MongoClient实例的可查询加密特定配置选项。

Automatic Encryption Options自动加密选项

The following table describes the structure of an AutoEncryptionOptions object:下表介绍了AutoEncryptionOptions对象的结构:

Property所有物Data Type数据类型Required?必需?Description描述
keyVaultNamespaceStringYesThe full namespace of the Key Vault collection.键保管库集合的完整命名空间
kmsProvidersObjectYes

The Key Management System (KMS) used by Queryable Encryption for managing your Customer Master Keys (CMKs).可查询加密用于管理客户主键(CMK)的键管理系统(KMS)。

To learn more about kmsProviders objects, see KMS Providers.要了解有关kmsProviders对象的详细信息,请参阅KMS提供程序

To learn more about Customer Master Keys, see Keys and Key Vaults.要了解有关客户主键的更多信息,请参阅键和键库

bypassAutoEncryptionBooleanNoSpecify true to bypass automatic encryption rules and perform explicit (manual) per-field encryption.指定true可绕过自动加密规则并执行显式(手动)每字段加密。
bypassQueryAnalysisBooleanNoDisables automatic analysis of outgoing commands. Specify true to use explicit encryption without the Automatic Encryption Shared Library. Defaults to false if not specified.禁用传出命令的自动分析。指定true可在不使用自动加密共享库的情况下使用显式加密。如果未指定,则默认为false
encryptedFieldsMapObjectNoA schema that specifies which fields to automatically encrypt and the types of queries allowed on those fields.一种模式,用于指定要自动加密的字段以及对这些字段允许的查询类型。
To learn how to construct an encryption schema, see Field Encryption and Queryability.要了解如何构建加密模式,请参阅字段加密和可查询性
extraOptionsObjectNoConfiguration options for the encryption library.加密库的配置选项。
To use the Automatic Encryption Shared Library instead of mongocryptd, specify the full absolute or relative file path to the library file in the cryptSharedLibPath property of this object.要使用自动加密共享库而不是mongocrypted,请在此对象的cryptSharedLibPath属性中指定库文件的完整绝对或相对文件路径。
If the driver can't load the Automatic Encryption Shared Library from this path, creating the MongoClient will fail.如果驱动程序无法从该路径加载自动加密共享库,则创建MongoClient将失败。
keyVaultClientMongoClientNoSpecifies the MongoClient that should connect to the MongoDB instance hosting your Key Vault collection.指定应连接到托管键库集合的MongoDB实例的MongoClient
If you omit this option, the driver uses the current MongoClient instance.如果省略此选项,则驱动程序将使用当前的MongoClient实例。
To learn more about Key Vault collections, see Key Vault Collections.要了解有关键库集合的详细信息,请参阅键库集合
tlsOptionsObjectNoThe TLS options to use when connecting to the KMS provider.连接到KMS提供程序时要使用的TLS选项。
Note

API DocumentationAPI文件

For more information on these automatic encryption options, see the API documentation for the AutoEncryptionOptions interface.有关这些自动加密选项的更多信息,请参阅AutoEncryptionOptions接口的API文档。