field mapping of a field of an embedded object is not taken into account if value of this field is unset
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
In org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec line 264 there's a code which should unset a field but the code use the property name of the entity instead of the field name of the mapping defined in GORM

So the code should use prop.mappedForm.targetName instead of prop.name
The code is the same in the most recent version of the class so the issue is still here
Context :
Grails : 4.0.0
GORM : 7.0.0.RELEASE
Groovy : 2.5.6
Contributor guide
Research direction
Start in org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec around line 264 and trace the unset path for fields in embedded objects. Verify that a field with a mapped target name is unset using that mapped name rather than the entity property name, and confirm the behavior with the relevant MongoDB persistence test coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, mongodb
- Domain
- database
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100