kmongo icon indicating copy to clipboard operation
kmongo copied to clipboard

How to use kotlin value classes with typed queries

Open arkadiuszSzast opened this issue 3 years ago • 1 comments

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!

arkadiuszSzast avatar Jan 02 '22 20:01 arkadiuszSzast

jackson kotlin module as an issue about this https://github.com/FasterXML/jackson-module-kotlin/issues/199

zigzago avatar Jan 09 '22 10:01 zigzago