Litote / kmongo

[deprecated] KMongo - a Kotlin toolkit for Mongo
https://litote.org/kmongo/
Apache License 2.0
781 stars 74 forks source link

setTo is not using kotlinx.serialization @SerialName when working with enuns #343

Closed sanford-ware2go closed 2 years ago

sanford-ware2go commented 2 years ago

When updating an enum property (@SerialName("completed") COMPLETED,) using typed queries, it gets serialized as "COMPLETED" instead of "completed".

update code: collection.findOneAndUpdate(filter, set(EntityWithStatus::status setTo EntityWithStatus.Status.COMPLETED), options)

version: 4.5.1

zigzago commented 2 years ago

I do not reproduce the bug. See related unit test https://github.com/Litote/kmongo/commit/a842ffc98a49378b23d8004cd4c50cdc869c57bc#diff-3e4b9b6781a3b635068bda24050724ccf4eb40e6af653190ecef7c400837598eR51