Skip to content

Support for Non-Queryable Encrypted Fields in CollectionOptions #4988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ricardohsmello opened this issue May 30, 2025 · 0 comments
Open
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@ricardohsmello
Copy link

ricardohsmello commented May 30, 2025

Hi team,

While testing out the CollectionOptions.encryptedCollection feature in Spring Data MongoDB version 4.5.0 with Queryable Encryption, I noticed that currently, it seems I can only encrypt fields that are also marked as queryable. However, in some use cases, I’d like to have fields that are encrypted but not queryable.

For example, I’d like to do something like this:

CollectionOptions collectionOptions = CollectionOptions.encryptedCollection(options -> options
    .encrypted(encrypted(string("name")).keyId(dkName.asUuid()))  // encrypted but not queryable
    .queryable(encrypted(int32("age")).algorithm("Range").keyId(dkAge.asUuid()), range().contention(0).min(0).max(130))  // encrypted and queryable
);

This would allow me to encrypt the "name" field without making it queryable, while still taking advantage of range queries on "age". As of now, the API doesn’t seem to support this scenario.

Let me know if you need anything.

Thanks in advance.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants