Limitations局限性
On this page本页内容
Overview概述Atlas SearchAtlas搜索MongoDB Support LimitationsMongoDB支持限制Contention Factor竞争因素Manual Compaction手动压实encryptedFieldsMap ModificationencryptedFieldsMap
修改Read and Write Operation Support读写操作支持Redaction修改Query Log and Database Profiler Redaction查询日志和数据库档案器修改Command and Aggregation Stage Output Redaction命令和聚合阶段输出修改Topology Support拓扑支持Sharding分片- CRUD
Collections集合Drop Collection删除集合Create Collection创建集合Query Types查询类型Encrypted Field Names加密字段名Views视图Collation排序规则Unique Indexes唯一索引The _id Field_id
字段Read/Write Query Support读/写查询支持
Overview概述
Consider these limitations and restrictions before enabling Queryable Encryption. Some operations are unsupported, and others behave differently.在启用可查询加密之前,请考虑这些限制和限制。有些操作不受支持,而另一些操作则表现不同。
Atlas Search
Queryable Encryption is incompatible with MongoDB Atlas Search.可查询加密与MongoDB Atlas Search不兼容。
MongoDB Support LimitationsMongoDB支持限制
Enabling Queryable Encryption on a collection redacts fields from some diagnostic commands and omits some operations from the query log. 对集合启用可查询加密会编辑某些诊断命令中的字段,并省略查询日志中的一些操作。This limits the data available to MongoDB support engineers, especially when analyzing query performance. To measure the impact of operations against encrypted collections, use a third party application performance monitoring tool to collect metrics.这限制了MongoDB支持工程师可用的数据,尤其是在分析查询性能时。要衡量针对加密集合的操作的影响,请使用第三方应用程序性能监控工具来集合度量。
For details, see the Redaction section.有关详细信息,请参阅Redaction部分。
Contention Factor竞争因素
Contention factor is a setting that helps tune performance based on the number of concurrent connections.争用系数是一种设置,它有助于根据并发连接的数量来调整性能。
You can set the contention factor only when specifying a field for encryption. Once you specify a field for encryption, the contention factor is immutable. If you don't specify the contention factor, it uses the default value of 只有在指定要加密的字段时,才能设置争用系数。一旦指定了要加密的字段,争用因子就不可变了。如果您没有指定争用因子,它将使用默认值4
.4
。
Manual Compaction手动压实
Manually run index compaction when your metadata collections exceed 1 GB. Compaction decreases the size of the metadata collections associated with encrypted fields, and improves performance.当元数据集合超过1 GB时,手动运行索引压缩。压缩减少了与加密字段相关联的元数据集合的大小,并提高了性能。
encryptedFieldsMap ModificationencryptedFieldsMap
修改
Do not modify the 不要修改传递给encryptedFieldsMap
passed to your MongoClient
. Doing so can result in unexpected and incorrect behavior when querying.MongoClient
的encryptedFieldsMap
。这样做可能会导致查询时出现意外和不正确的行为。
Read and Write Operation Support读写操作支持
The mongod
only stores encrypted BinData
and applies any aggregation expression or query operator specifying an encrypted field against the BinData
value. While the expression or operator may support BinData
fields, the resulting value may be incorrect or unexpected when compared to issuing that same expression or operator against the decrypted value. mongod
只存储加密的BinData
,并根据BinData
值应用任何聚合表达式或指定加密字段的查询运算符。虽然表达式或运算符可能支持BinData
字段,但与针对解密值发布相同的表达式或运算符相比,结果值可能不正确或出乎意料。The 如果表达式或运算符不支持mongod
throws an error if the expression or operator does not support BinData
values.BinData
值,mongod
将抛出错误。
Redaction修改
To improve security, Queryable Encryption redacts fields from some diagnostic commands on encrypted collections, and omits certain operations from the query log. An encrypted collection is any collection with the 为了提高安全性,可查询加密对加密集合上的一些诊断命令中的字段进行了编辑,并省略了查询日志中的某些操作。加密集合是指具有encryptedFields
option.encryptedFields
选项的任何集合。
Query Log and Database Profiler Redaction查询日志和数据库档案器修改
The CRUD operations below are omitted from the slow operations query log and the Database Profiler 在加密集合上运行以下CRUD操作时,它们将从慢速操作查询日志和数据库档案器system.profile
collection when you run them on an encrypted collection.system.profile
集合中省略。
aggregate
count
delete
find
findAndModify
insert
update
db.collection.bulkWrite()
ThecompactStructuredEncryptionData
command命令ThecleanupStructuredEncryptionData
command命令
Command and Aggregation Stage Output Redaction命令和聚合阶段输出修改
The collStats
command and $collStats
aggregation stage:collStats
命令和$collStats
聚合阶段:
Omit省略"queryExecStats"
Omit省略"latencyStats"
RedactRedact"WiredTiger"
, if present, to include only theurl
field."WiredTiger"
(如果存在),仅包括url
字段。
The currentOp
command and $currentOp
aggregation stage:currentOp
命令和$currentOp
聚合阶段:
Omit all fields after省略"command"
."command"
后面的所有字段。Redact修改"command"
to include only the first element,$comment
, and$db
."command"
以仅包括第一个元素$comment
和$db
。
The top
command only returns the collection name of encrypted collections.top
命令只返回加密集合的集合名称。
The $planCacheStats
aggregation stage omits operations against encrypted collections, even though the operations are cached as normal.$planCacheStats
聚合阶段省略了针对加密集合的操作,即使这些操作是正常缓存的。
Topology Support拓扑支持
Replica sets and sharded clusters are supported支持副本集和分片集群Standalone deployments are not supported不支持独立部署Secondary reads are not supported不支持辅助读取
Sharding分片
Metadata collections must not be sharded元数据集合不得进行分片Shard keys must not be encrypted fields分片键不能是加密字段For sharded cluster transactions that use Queryable Encryption, you must set readConcern to对于使用可查询加密的分片集群事务,必须将snapshot
.readConcern
设置为snapshot
。
CRUD
Queryable Encryption does not support batch operations. The following operations are not supported:可查询加密不支持批处理操作。不支持以下操作:Queryable Encryption limits可查询加密限制db.collection.findAndModify()
arguments.db.collection.findAndModify()
参数。fields
is not allowedfields
是不允许的new
must be false必须为false
When performing an upsert operation, any encrypted fields in the filter are excluded from the insert.执行追加启动操作时,筛选器中的任何加密字段都将从插入中排除。
Collections集合
You cannot use Client-Side Field Level Encryption with Queryable Encryption on the same collection.不能在同一集合上使用客户端字段级加密和可查询加密。Queryable Encryption does not support migration from collections encrypted with Client-Side Field Level Encryption. You must decrypt your documents and insert them one-by-one.可查询加密不支持从使用客户端字段级加密加密的集合迁移。您必须解密您的文档,然后将它们逐一插入。Queryable Encryption does not support automatic migration from an unencrypted collection. You must insert the documents one-by-one.可查询加密不支持从未加密的集合自动迁移。您必须一个接一个地插入文档。
Queryable Encryption supports new collections only. You cannot add or remove Queryable Encryption to existing collections.可查询加密仅支持新集合。无法向现有集合添加或删除可查询加密。You cannot rename a collection with encrypted fields.不能重命名具有加密字段的集合。You cannot specify如果jsonSchema
todb.createCollection()
when creating a Queryable Encryption collection if thejsonSchema
contains theencrypt
keyword.jsonSchema
包含encrypt
键,则在创建可查询加密集合时,不能将jsonSchema
指定为db.createCollection()
。You can specify both只要encryptedFields
andjsonSchema
todb.createCollection()
as long as your jsonSchema does not contain validation for encrypted fields.jsonSchema
不包含加密字段的验证,就可以将encryptedFields
和jsonSchema
都指定给db.createCollection()
。
Queryable Encryption does not support Views, Time Series Collections, or capped collection.可查询加密不支持视图、时间序列集合或封顶集合。Queryable Encryption does not support TTL Indexes or Unique Indexes.可查询加密不支持TTL索引或唯一索引。You cannot disable不能禁用jsonSchema
validation.jsonSchema
验证。When a collection uses the当集合使用encryptedFields
option:encryptedFields
选项时:You cannot set不能将validationLevel
tonone
.validationLevel
设置为none
。You cannot set不能将validationAction
towarn
.validationAction
设置为warn
。
Drop Collection删除集合
Dropping collections from a从未配置为可查询加密的MongoClient中删除集合不会删除关联的元数据集合。如果在删除元数据集合之前删除包含加密字段的集合,MongoClient
that is not configured for Queryable Encryption doesn't drop the associated metadata collections.mongod
logs a warning if you drop a collection with encrypted fields before dropping the metadata collections.mongod
会记录一条警告。
When dropping a collection with a 当使用配置为可查询加密的MongoClient
configured for Queryable Encryption, QE compatible drivers drop the associated metadata collections as well.MongoClient
删除集合时,QE兼容的驱动程序也会删除关联的元数据集合。
Create Collection创建集合
Always explicitly create any collections that use Queryable Encryption. Implicit collection creation doesn't create the necessary indexes and metadata collections, resulting in poor query performance.始终显式创建任何使用可查询加密的集合。隐式集合创建不会创建必要的索引和元数据集合,导致查询性能较差。
Query Types查询类型
The query type you specify for a field when creating the collection in 在encryptedFieldsMap
is immutable. You cannot add new query types to an existing field, and you cannot change the existing query type.encryptedFieldsMap
中创建集合时为字段指定的查询类型是不可变的。不能向现有字段添加新的查询类型,也不能更改现有的查询类型。
Encrypted Field Names加密字段名
Encrypted field names are immutable. For example, if you specify 加密字段名是不可变的。例如,如果将ssn
as a field to encrypt, you cannot $rename
the field name to taxPayerID
.ssn
指定为要加密的字段,则不能将字段名称重命名为taxPayerID
。
Views视图
Applications cannot rely on the automatic encryption validation to prevent unsupported queries against views on collections with encrypted fields.应用程序不能依靠自动加密验证来防止对具有加密字段的集合的视图进行不受支持的查询。
Queries against views on collections containing values encrypted with Queryable Encryption may return unexpected or incorrect results if either the underlying view aggregation pipeline or the query references encrypted fields. 如果基础视图聚合管道或查询引用了加密字段,则对包含使用可查询加密加密的值的集合上的视图的查询可能会返回意外或不正确的结果。If creating a view on a collection containing values encrypted with Queryable Encryption, avoid operating on encrypted fields to mitigate the risk of unexpected or incorrect results.如果在包含使用可查询加密加密的值的集合上创建视图,请避免对加密字段进行操作,以降低意外或错误结果的风险。
Collation排序规则
Queryable Encryption ignores user-specified collations or collection default collations. Encryption obscures the field value and prevents normal collation behavior. Collation-sensitive queries against encrypted fields may return unexpected or incorrect results.可查询加密忽略用户指定的排序规则或集合默认排序规则。加密会模糊字段值并阻止正常的排序规则行为。针对加密字段的对排序规则敏感的查询可能会返回意外或不正确的结果。
For more information on collations, see Collation Document.有关排序规则的详细信息,请参阅排序规则文档。
Queryable Encryption-compatible drivers have a list of supported operations for automatic encryption. For unsupported read and write operations, the underlying support library cannot introspect the collection catalog to identify the default collation. 可查询加密兼容的驱动程序有一个支持自动加密的操作列表。对于不受支持的读写操作,底层支持库无法内省集合目录以标识默认排序规则。Applications therefore cannot rely on the Queryable Encryption validation to prevent querying on encrypted fields with collation defaults.因此,应用程序不能依赖可查询加密验证来阻止对具有排序规则默认值的加密字段进行查询。
Unique Indexes唯一索引
Unique indexes can't guarantee uniqueness if the index key specifies any encrypted fields.如果索引键指定任何加密字段,则唯一索引不能保证唯一性。
Queryable Encryption always outputs a different encrypted value, even for the same input. 可查询加密始终输出不同的加密值,即使对于相同的输入也是如此。The server considers each encrypted value unique, even though the decrypted value may not be. This means that even if a collection uses an index-enforced unique constraint on fields, the collection can still contain multiple documents with duplicate plaintext values for that field.服务器认为每个加密的值都是唯一的,即使解密的值可能不是。这意味着,即使集合对字段使用索引强制的唯一约束,该集合仍然可以包含多个具有该字段重复明文值的文档。
Queryable Encryption compatible drivers configured for automatic encryption support some operations for automatic encryption. 为自动加密配置的可查询加密兼容驱动程序支持一些自动加密操作。For unsupported read and write operations, the underlying library can't introspect the index catalog to identify a given field as unique. Applications can't rely on automatic encryption validation to prevent unique constraint violations on randomly-encrypted fields.对于不受支持的读写操作,底层库无法内省索引目录以将给定字段标识为唯一字段。应用程序不能依靠自动加密验证来防止对随机加密字段的唯一约束冲突。
The _id Field_id
字段
You cannot configure Queryable Encryption to encrypt the 您不能将可查询加密配置为加密_id
field because it relies on the value auto-generated by MongoDB._id
字段,因为它依赖于MongoDB自动生成的值。
Read/Write Query Support读/写查询支持
Automatic encryption supports a subset of commands, query operators, update operators, aggregation stages, and aggregation expressions. For the list of supported operations, see Supported Operations for Automatic Encryption.自动加密支持命令、查询运算符、更新运算符、聚合阶段和聚合表达式的子集。有关支持的操作列表,请参阅支持的自动加密操作。