Let's create a new Person entity class to store to MongoDB. The following snippet shows a Person class with an ID and a name:
public class Person {
@Id
private String id;
private String name;
public Person() {
}
public Person(String name) {
super();
this.name = name;
}
}