Morphia projection behavior for instance variable with default value
问题 I'm not sure if its the way Morphia is designed but here it goes... Student.class (methods omitted) @Entity(value = "students", noClassnameStored = true) public class Student { @Id private String id = new ObjectId().toString(); private String name; private String city = "London"; // Default Value } NOTE: That I have assigned a DEFAULT value to Instance variable city . Now the code... Student s1 = new Student("James Bond"); // London IS his default city ds.save(s1); Student s2 = new Student(