I'm new to MongoDB. I'm using Spring boot 2.1.3.RELEASE.
I want to perform validation on MongoDB documents (on message as per below code), currently, it saves documents even everything passed as null.
I have gone through a couple of answers like Spring data mongoDb not null annotation like Spring data Jpa
public class Comment {
@NotBlank(message = "Comment's message can't be blank")
private String message;
@CreatedDate
private Date createdDate;
@CreatedBy
private String createdBy;
}
Is there any way to achieve the same without using hibernate-validator dependency?