-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Repository query projection not working as expected since 3.4.x #4524
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Oct 9, 2023
Thanks for reporting and the reproducer. We'll have a look. |
christophstrobl
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Oct 10, 2023
jcedenopyx
changed the title
Repository query not working since 3.4.x
Repository query projection not working as expected since 3.4.x
Oct 10, 2023
Thanks for fixing this so quick! Is this going out on October 13th? |
@jcedenopyx with the next release, yes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a
MongoRepository<A, B>
, query functions that project from type A to type C (with compatible fields), spring attempts to convert the full object to the Id field type.This behavior worked fine until spring data 3.3.x. Using
@Id
or@MongoId
on the Id field has no effect, but using@Field("_id")
makes it so that it maps properly.Demo reproducing the bug: https://github.com/jcedenopyx/spring-data-mongo-query-projection-issue/blob/master/src/test/java/me/jcedeno/demo/DemoApplicationTests.java#L89-L95
The text was updated successfully, but these errors were encountered: