Including CSFLE on existing spring boot + mongo DB app

38 Views Asked by At

I have working application spring boot + mongo db. Spring boot 3.1 Java 17 Mongo 7 I have one collection which generate dynamically and all are working fine.

Now, I'm trying to integrate the CSFLE with my exiting app. When I done CSFLE POC its worked well and able to get the decrypted data and store the date in encrypted etc.

After integrating the CSFLE I'm getting below error.

"Automatic client-side field level encryption supports the $lookup and $graphLookup only if the from collection matches the collection on which the aggregation runs against (i.e. self-lookup operations). $lookup and $graphLookup stages that reference a different from collection return an error. " Also this as well when I tried to comment on the generation of the schema using "db.runCommand(new Document("collMod", collStr).append("validator", jsonSchemaWrapper(schema)));" as per tutorials suggests.

Pipeline over an encrypted collection cannot reference additional collections

Even though there is no encryption field in this collection, still shows the above error. I mean the actual encryption data is present in the different collection.

I have tried below link for the debugging and reference but no luck. Any suggestion or fix on this issue or any better approach for CSFLE integration on existing application?

src code ref: https://github.com/mongodb-developer/mongodb-java-spring-boot-csfle https://www.mongodb.com/developer/code-examples/java/java-spring-data-client-side-field-level-encryption/

https://www.mongodb.com/community/forums/t/mongoerror-pipeline-over-an-encrypted-collection-cannot-reference-additional-collections/13386/3 MongoDB Client Side Field Level Encryption (CSFLE) Restricts Operations On Unencrypted Collections

0

There are 0 best solutions below