Grail 3.1 empty list is saving as null in mongodb
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
Hey, I am using grails 3.1. In this version, by default mongo is using MongoCodecSession but I have convertd it to MongoSession for some reason. Now when I am saving my domain instance in mongodb, it is saving empty list as null values which causes problem is $push. Below is my saving code
```
if(commit){
instance.save(flush: true)
instances.add(instance)
}
```
Any help?
Contributor guide
Research direction
Start by reproducing the Grails 3.1 save path using MongoSession rather than the default MongoCodecSession, with a domain instance containing an empty list. Inspect how instance.save(flush: true) persists empty lists and verify whether the stored value remains an empty list so subsequent $push operations work correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100