https://kotlinlang.org logo
#kmongo
Title
# kmongo
t

tim

04/07/2022, 10:28 AM
Hello, is it possible to not have defaults encoded when inserting a documents (I’m using kotlinx.serialization)? For example given:
Copy code
data class Foo(val name: String, val other: String? = null)
val thing = Foo("bar")
...
insert(thing)
The document in mongo is
{"name": "bar", "other": null}
when I want it to be
{"name":"bar"}
. Alternatively, can I provide my own Json instance to kmongo? Thanks!