spring-projects / spring-projects/spring-data-mongodb
MappingMongoConverter#writePropertyInternal should prefer custom converters before simple type conversion.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
org.springframework.data.mongodb.core.convert.MappingMongoConverter#writePropertyInternal(Object, DocumentAccessor, MongoPersistentProperty) appears to prefer serializing as a collection/map before checking if there are custom converters.
This is different than MappingMongoConverter#writeInternal(Object, Bson, TypeInformation), where the custom target is honored first. Is this by design? What is the reasoning for treating properties any differently than the objects themselves?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MappingMongoConverter#writePropertyInternal(Object, DocumentAccessor, MongoPersistentProperty) and compare its conversion order with MappingMongoConverter#writeInternal(Object, Bson, TypeInformation). Determine whether the differing custom-converter precedence is intentional; done means the expected behavior and its rationale are established, with any required alignment identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb
- Domain
- database
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100