Litote / kmongo

[deprecated] KMongo - a Kotlin toolkit for Mongo

Home Page:https://litote.org/kmongo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KMongo unable to save field with name "isClosed" and type "String"

himanshuvaish93 opened this issue · comments

Hi Team,

I have observed that when we are trying to save a document using kmongo methods, field "isClosed" is ignored if it is of type String.
However same field name with Boolean data type works.
Also, if document contains an additional field with name "closed" and type String along with "isClosed", it doesn't save "closed" and rather saves "isClosed".
We have a use case where we need to persist isClosed field name but facing issue.

Is this something which is expected or isClosed as string is some keyword ?

Indeed there is a bug.
Workaround: data class Test1(@get:JsonProperty("isClosed") val isClosed:String)

Looks like a bug in jackson-module-kotlin lib FasterXML/jackson-module-kotlin#575

Thank you for reviewing. We are using the workaround for now.