This is what I have:
I have two linked documents (one to one relationship).
User:
@Document(collection = "user")
public class User implements Serializable {
@Id
private String id;
@Field("firstname")
private String firstname;
...
}
UserExtra:
@Document(collection = "user_extra")
public class UserExtra implements Serializable {
@Id
private String id;
@Field("phone_number")
private String phoneNumber;
@DBRef
@Field("user")
private User user;
...
}
So, I want to maps ids between these two documents in the proper way (ie same Id in user and user_extra). Any idea?