Skip to content

MongoOperations findAndModify and updateFirst do not include the _class in Map values [DATAMONGO-1236] #2150

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

Closed
spring-projects-issues opened this issue Jun 8, 2015 · 2 comments
Assignees
Labels
in: mapping Mapping and conversion infrastructure type: bug A general bug

Comments

@spring-projects-issues
Copy link

Amy Aldredge opened DATAMONGO-1236 and commented

When a map of type LinkedHashMap<String, Object> is updated via MongoOperations findAndModify or updateFirst, the _class field is not saved for the map values. Therefore, later reads of the data do not convert the value to the correct type, instead leaving it as LinkedHashMap.

Please see attached maven project for test illustrating the problem.


Affects: 1.6.2 (Evans SR2)

Attachments:

Referenced from: pull request #301

Backported to: 1.7.1 (Fowler SR1), 1.6.3 (Evans SR3)

@spring-projects-issues
Copy link
Author

Amy Aldredge commented

This is also a problem when updating a single field in the document if the field is an Object.

@spring-projects-issues
Copy link
Author

Christoph Strobl commented

thanks Amy Aldredge for report and tests - good catch! As it seems update mapping does not correctly pass on type hints for the defined map value type. will have to check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mapping Mapping and conversion infrastructure type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants