I\'m learning MongoDB with Java. I\'m trying to insert data to MongoDB with Java driver. I\'m doing inserting like in MongoDB tutorial and every thing is okey. But if I want
I'm using MongoDB POJO support. In my case, I had this "clue" WARNing before the exception:
org.bson.codecs.pojo : Cannot use 'UserBeta' with the PojoCodec.
org.bson.codecs.configuration.CodecConfigurationException: Property 'premium' in UserBeta, has differing data types: TypeData{type=PremiumStatus} and TypeData{type=Boolean}.
My class UserBeta
had getPremium()
, setPremium()
, and isPremium()
. I already @BsonIgnore
-d the isPremium()
but for some reason it's still detected and causing conflict.
My workaround is to rename isPremium()
to isAnyPremium()
.