kmongo
kmongo copied to clipboard
How to use kotlin value classes with typed queries
Hey!
I'm looking for an easy way to use typed queries with kotlin value classes. E.g.
data class Account(@BsonId val id: Id<Account>, val email: EmailAddress)
@JvmInline
value class EmailAddress(val value: String)
and then it will be awesome to search by email like that:
collection.findOne(Account::email eq email)
Is it somehow possible now or maybe there are plans to support it? Thanks!
jackson kotlin module as an issue about this https://github.com/FasterXML/jackson-module-kotlin/issues/199