mongodb-developer / mongodb-java-spring-boot-csfle

This repository contains a Java Spring Boot template to start a MongoDB project with CSFLE.
Apache License 2.0
2 stars 1 forks source link

Facing error with pipeline queries #1

Open venuboppudi opened 8 months ago

venuboppudi commented 8 months ago

We have a contacts collection with email field. after implementing the encryption according to the tutorial. I am facing this issue.

csfle "analyze_query" failed: Pipeline over an encrypted collection cannot reference additional collections. [Error 2, code 51204]

We have aggregations running on the collection which includes a lookup stage but the pipeline doesn't use the email field. How do I resolve this issue?

schemas: {acms-db.contacts={"encryptMetadata": {"keyId": [{"$binary": {"base64": "s72X3JZdTkaJNFpMqQm8rw==", "subType": "04"}}]}, "type": "object", "properties": {"email": {"encrypt": {"bsonType": "string", "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"}}}}}

@MaBeuLux88 help needed

MaBeuLux88 commented 8 months ago

Hey @venuboppudi,

I think I have answered a similar problem here: https://www.mongodb.com/community/forums/t/automatic-csfle-spring-boot/263417.

Cheers, Maxime.