java mongo driver – how do I save entity to mongo that does not serialize with getters
I use java mongo driver to access mongo. I have this example entity class: public class TestJavaMongoDriverEntityMDO { @BsonProperty("_id") private ObjectId id; @BsonProperty("val") private String val; public TestJavaMongoDriverEntityMDO() { this.val = null; } public TestJavaMongoDriverEntityMDO(String val) { this.val = val; } public String getVal() { if (val == null) { return "someValue"; } return val;