Closed
Description
The current implementation treat String value as Fields instead of Field. However org.springframework.data.mongodb.core.aggregation.DocumentEnhancingOperation.computeValue(Object, AggregationOperationContext)
doesn't support Fields but only Field, the generated BSON document is incorrect.
I think change this line from:
valueMap.put(field, value instanceof String stringValue ? Fields.fields(stringValue) : value);
to
valueMap.put(field, value instanceof String stringValue ? Fields.field(stringValue) : value);
should fix that issue.