Skip to content

Commit f3e22e2

Browse files
DOCS-15305 Validation with encrypted fields (#7198) (#7456)
* Added schema validation content * Drafted partial filter content * Doc constant fix * Fixed line break * Softened wording * Internal PR feedback * Internal PR feedback * Converted restrictions to bulleted list, removed include on behavior that starts as of 5.0 * Syntax * Syntax * reverted bulleted list due to syntax issues * Syntax fix again * External review feedback * Updated with current behavior
1 parent f55f50b commit f3e22e2

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed

source/core/index-partial.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,15 @@ specified filter expression and expire only those documents. For details, see
174174
Restrictions
175175
------------
176176

177-
.. include:: /includes/fact-5.0-multiple-partial-index.rst
177+
- You cannot specify both the ``partialFilterExpression`` option and
178+
the ``sparse`` option.
178179

179-
You cannot specify both the ``partialFilterExpression`` option and
180-
the ``sparse`` option.
180+
- ``_id`` indexes cannot be partial indexes.
181181

182-
``_id`` indexes cannot be partial indexes.
182+
- Shard key indexes cannot be partial indexes.
183+
184+
- .. include:: /includes/queryable-encryption/qe-csfle-partial-filter-disclaimer.rst
183185

184-
Shard key indexes cannot be partial indexes.
185186

186187
Examples
187188
--------

source/core/schema-validation/specify-json-schema.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ You can't specify schema validation for:
4646

4747
- :ref:`System collections <metadata-system-collections>`
4848

49+
.. include:: /includes/queryable-encryption/qe-csfle-schema-validation.rst
50+
4951
Steps
5052
-----
5153

source/core/schema-validation/specify-json-schema/json-schema-tips.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,9 @@ With the preceding validation, this document is allowed:
124124

125125
``null`` field values are not the same as missing fields. If a field
126126
is missing from a document, MongoDB does not validate that field.
127+
128+
129+
Validation with Encrypted Fields
130+
--------------------------------
131+
132+
.. include:: /includes/queryable-encryption/qe-csfle-schema-validation.rst
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If you are using :ref:`{+csfle+} <manual-csfle-feature>` or :ref:`{+qe+}
2+
<qe-manual-feature-qe>`, a ``partialFilterExpression`` cannot reference an
3+
encrypted field.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
If you have :ref:`{+csfle+} <manual-csfle-feature>` or :ref:`{+qe+}
2+
<qe-manual-feature-qe>` enabled on a collection, validation is
3+
subject to the following restrictions:
4+
5+
* For {+csfle-abbrev+}, when running :dbcommand:`collMod`, the
6+
:ref:`libmongocrypt<qe-reference-libmongocrypt>` library prefers the the JSON
7+
:ref:`{+enc-schema+} <csfle-fundamentals-create-schema>` specified in the
8+
command. This enables setting a schema on a collection that does not yet
9+
have one.
10+
11+
* For {+qe+}, any JSON schema that includes an encrypted field results in a
12+
query analysis error.

source/reference/command/createIndexes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ Each document in the ``indexes`` array can take the following fields:
206206

207207
.. include:: /includes/fact-partial-filter-expression-operators.rst
208208

209+
.. include:: /includes/queryable-encryption/qe-csfle-partial-filter-disclaimer.rst
210+
209211
You can specify a ``partialFilterExpression`` option for all MongoDB
210212
:ref:`index types <index-types>`.
211213

0 commit comments

Comments
 (0)