Note
For details on a specific method, including syntax and examples, click on the link to the method's reference page.有关特定方法的详细信息,包括语法和示例,请单击该方法参考页面的链接。
The mongosh ClientEncryption methods require a database connection with in-use encryption enabled. If the current database connection was not initiated with in-use encryption enabled, either:mongosh ClientEncryption方法需要启用正在使用的加密的数据库连接。如果当前数据库连接不是在启用使用中的加密的情况下启动的,则:
Use the使用Mongo()constructor from themongoshto establish a connection with the required in-use encryption options. TheMongo()method supports the following Key Management Service (KMS) providers for Customer Master Key (CMK) management:mongosh中的Mongo()构造函数与所需的正在使用的加密选项建立连接。Mongo()方法支持以下用于客户主键(CMK)管理的键管理服务(KMS)提供程序:or
Use the使用mongoshcommand line options to establish a connection with the required options.mongosh命令行选项建立与所需选项的连接。The command line options only support the Amazon Web Services KMS provider for CMK management.命令行选项仅支持用于CMK管理的Amazon Web Services KMS提供程序。
The following methods are for 以下方法仅适用于mongosh only. For instructions on implementing Client-Side Field Level Encryption (CSFLE) or Queryable Encryption (QE) using a MongoDB driver, defer to the driver documentation. mongosh。有关使用MongoDB驱动程序实现客户端字段级加密(CSFLE)或可查询加密(QE)的说明,请参阅驱动程序文档。See Client-Side Field Level Encryption Compatibility or Queryable Encryption Compatibility for supported drivers.有关支持的驱动程序,请参阅客户端字段级加密兼容性或可查询加密兼容性。
Commands with aliases are grouped together.带有别名的命令被组合在一起。
| CSFLE | QE | ||
|---|---|---|---|
getKeyVault() | ✓ | ✓ | |
KeyVault.createKey()KeyVault.createDataKey() | ✓ | ✓ | |
KeyVault.deleteKey() | ✓ | ✓ | |
KeyVault.getKey() | ✓ | ✓ | |
KeyVault.getKeys() | ✓ | ✓ | |
KeyVault.addKeyAlternateName()KeyVault.addKeyAltName() | ✓ | ✓ | |
KeyVault.removeKeyAlternateName()KeyVault.removeKeyAltName() | ✓ | ✓ | |
KeyVault.getKeyByAltName() | ✓ | ✓ | |
KeyVault.rewrapManyDataKey() | ✓ | ✓ | |
getClientEncryption() | ✓ | ✓ | |
ClientEncryption.createEncryptedCollection() | ✓ | ✓ | |
ClientEncryption.encrypt() | ✓ | ✓ | |
ClientEncryption.encryptExpression() | ✓ | ||
ClientEncryption.decrypt() | ✓ | ✓ |