po prostu dodaj @Version
pole do Ciebie @Document
klasę i zostaw @EnableMongoAuditing
tj.
@Document
public class Profile implements Persistable<String>{
@Version
private Long version;
@Id
private String username;
@CreatedDate
public Date createdDate;
public Profile(String username) {
this.username = username;
}
@Override
public String getId() {
return username;
}
@Override
public boolean isNew() {
return username == null;
}
}
Oto powiązany problem:https://jira.spring.io/browse/DATAMONGO-946