Custom Serialization in Java SDK 1.10 for MongoDB
Open
- Dominant language
- Java
- Stars
- 300
- Forks
- 230
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 4
Description
Hello,
I'm currently working with Java SDK 1.10 to store a POJO in MongoDB, and I've encountered an issue with the default serialization. When I save the POJO, the result is stored as a string in MongoDB, like this:
`value: '{product: "prod", name: "example"}'`
I attempted to create a custom serialization using a Jackson object mapper, but unfortunately, the result remains the same:
`OBJECT_MAPPER.writeAsByte(pojo)`
What I'm aiming for is to have the POJO stored as an object in MongoDB, like this:
```
value: {
product: "prod",
name: "example"
}
```
Contributor guide
Assessment
This issue has not been assessed yet.