просто добавете @Version
поле за вас @Document
клас и оставете @EnableMongoAuditing
т.е.
@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;
}
}
Ето свързан проблем:https://jira.spring.io/browse/DATAMONGO-946