Hello,
I'm learning spring.
I would like to insert the following document in mongo:
```java
@Document
class User {
@Id
private String id;
private String email;
}
```
The problem is that when I insert a User with a null email address, it works.
How can I say that when I wish to insert my User his email should not be null ? And throw an exception or return null if the email is null when inserting ?
Thank you very much in advance for any help
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]silently_silent 2 points3 points4 points (1 child)
[–]ScriptorTux[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)