dapr / dapr/java-sdk

Custom Serialization in Java SDK 1.10 for MongoDB

Open
#942 2 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.