-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.12.7, 4.1.1
-
Component/s: Client Side Encryption
-
None
An aggregation pipeline $lookup fails even if the 2 involved collections are unencrypted. The underlying connection has csfle enabled since the same connection is used to work on the collections with the encrypted fields.
Exception received:
Exception in encryption library: Command failed with error 51204 (Location51204): 'Pipeline over an encrypted collection cannot reference additional collections.' on server localhost:27020. The full response is
code snippet:
Bson lookup = new Document("$lookup",
new Document("from", "samplecollection1")
.append("localField", "field1")
.append("foreignField", "field2")
.append("as", "samplecollection1"));
List<Bson> filters = new ArrayList<>();
filters.add(lookup);
MongoCollection<Document> collection = encryptedClient.getDatabase(recordsDb).getCollection("samplecollection2");
AggregateIterable<Document> it = collection.aggregate(filters);
for (Document row : it)
{ System.out.println(row.toJson()); }Note: the aggregation works fine if the connection is created without csfle options.
- related to
-
SERVER-50092 [FLE] with encryption on collection and $lookup with two non-encrypted collections fails
- Backlog