dozd / mongo-mapper

Easy POJO codec for MongoDB in Java
Apache License 2.0
27 stars 9 forks source link

Support for default Value #12

Open notz opened 7 years ago

notz commented 7 years ago

Very helpful for updates, if a document has a new int field with default value x. Currently you have to update all document in an manual process before release, otherwise the documents can't be read.

dozd commented 7 years ago

Or you can use Integer?

notz commented 7 years ago

Yes, but then i always need a null check in the application which is not really nice. I would prefer a default value and no null check. Or at least don't throw a exception on this case -> the object already has a default value.

dozd commented 7 years ago

Ok I see the point. It should not be large change.