Skip to content

Fix AddFieldsOperationBuilder to treat String value as Field reference #4959

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kssumin
Copy link

@kssumin kssumin commented May 2, 2025

String values in MongoDB aggregation operations should be treated as field references, but the current implementation in AddFieldsOperationBuilder produces invalid MongoDB syntax. MongoDB expects field references in the format $fieldName, but the current code generates an incompatible complex object structure.

This commit modifies the AddFieldsOperationBuilder to correctly treat String values as field references.
When a String value is passed, it is now interpreted as a reference to another field, following MongoDB's field reference syntax.

Closes spring-projects#4933

Signed-off-by: kssumin <201566@jnu.ac.kr>
@christophstrobl
Copy link
Member

Thank you for the PR @kssumin !

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

Successfully merging this pull request may close these issues.

AddFieldsOperationBuilder.addFieldWithValueOf should treat String value as Field reference
3 participants