@ -135,8 +135,26 @@ The configuration for QE via Spring Data uses the same building blocks (a xref:m
@@ -135,8 +135,26 @@ The configuration for QE via Spring Data uses the same building blocks (a xref:m
You can configure Queryable Encryption either manually or in a derived way:
- Manual setup gives you full control over how encrypted fields are declared and how collections are created. It's useful when you need to explicitly manage data keys, encryption algorithms, and field mappings.
- Derived setup relies on annotations in your domain model and automatically generates the required encrypted field configuration from it. This is simpler and recommended for typical Spring applications where your data model is already annotated.
**Manual setup**
Manual setup gives you full control over how encrypted fields are declared and how collections are created.
It's useful when you need to explicitly manage data keys, encryption algorithms, and field mappings.
** ✅ Full control over encryption configuration
** ✅ Explicitly manage data keys and algorithms
** ✅ Allows for complex encryption scenarios
** ✅ Explicit configuration avoids the risk of surprises (e.g. missing configuration because of improper annotations or class-path scanning)
** ⚠️ An Explicit Field Configuration can diverge from the domain model and you must keep it in sync with the domain model
**Derived setup*
Derived setup relies on annotations in your domain model and automatically generates the required encrypted field configuration from it.
This is simpler and recommended for typical Spring applications where your data model is already annotated.
** ✅ Domain model-driven configuration
** ✅ Easy to set up and maintain
** ⚠️ Might not cover all complex scenarios
** ⚠️ Risk of surprises (e.g. missing configuration for documents based on subtypes because of improper annotations or class-path scanning)
- Additional options for eg. `min` and `max` need to match the actual field type. Make sure to use `$numberLong` etc. to ensure target types when parsing bson String.
- Queryable Encryption will an extra field `__safeContent__` to each of your documents.
Unless explicitly excluded the field will be loaded into memory when retrieving results.