Skip to content
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

Project problem with similar names #4509

Open
OddyUlrich opened this issue Sep 16, 2023 · 2 comments
Open

Project problem with similar names #4509

OddyUlrich opened this issue Sep 16, 2023 · 2 comments
Assignees
Labels
type: bug A general bug

Comments

@OddyUlrich
Copy link

Good afternoon, I am currently doing a project where I am using an "aggregation" to do a $lookup, a $unwind and finishing with a $project. To simplify the data and since I don't need all the information that $lookup brings me I use the project to get, , among other things, the id and some fields of the document to which I do $lookup.

The problem comes when I go to see the result of the query and the instance of the class where the data is, doesn't have the correct data.
This is because if the name of the field in the $project has one similar or equal to the one in the value field, this value is not copied and I don't really understand why...

I attach a demo where in the file "TfgBackendApplication.java" you can use debugger to see the fields of an example where one field is wrong and the other is right, although they are also printed on the screen.

I'm sorry if this is a stupid question, but it's really taken me a while to realise this...
demo.zip

@christophstrobl
Copy link
Member

@OddyUlrich thanks for reporting and the reproducer - we'll have a look

@christophstrobl
Copy link
Member

The string aggregation pipeline does no in depth analysis of the operations in use and attempts to map field names against the source domain type. Camel case splitting unfortunately leads to the false detection of ExerciseBattery.id for the path Exercise -> exerciseBattery -> id where it should just use exerciseBatteryId.

@christophstrobl christophstrobl added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants