Morphia does not store null/empty fields by default. Is there a way to enable this?
In the interests of answering the question asked, you can:
MapperOptions.setStoreNulls(boolean)
MapperOptions.setStoreEmpties(boolean)
.You can get a MapperOptions
reference from the mapper instance by Mapper.getOptions()
.
However, the Mapper
class is internal only and is deprecated:
this class will be internalized in 2.0
Same deprecation applies for before mentioned setter methods in class MapperOptions
, instead the JavaDocs recommend:
use the Builder instead