I'm trying to make a test application for myself, using Spring Data MongoDB . I want to make the user to create their own lists. How does the base in RoboMongo look like

 @Document() public class ToDo { @Id private Object id; private List<Item> day; private List<Item> week; private List<Item> month; private List<Item> year; private List<Item> other; ToDo(){ this.id = new ObjectId(); this.day = new ArrayList<>(); this.week = new ArrayList<>(); this.month = new ArrayList<>(); this.year = new ArrayList<>(); this.other = new ArrayList<>(); } private class Item { @Id private Object id; private boolean completed; private String description; private Date date; public Item(String description, boolean completed) { this.description = description; this.completed = completed; this.date = new Date(); this.id = new ObjectId(date); } } public void createItem(String name){ new Item(name, false); } } 

Is it okay that the result is not exactly the Pojo model, is it not necessary when using Spring? And in general, with such a model, is it possible to create your own lists, well, and add-move objects from there? Or is it better not to create such lists and come up with a different approach?

    0