I'm working with Firestore in my Android app, and I'm using a Model to handle data with Firestore. But I want to decrease my Firestore reads for small data sets. After searching the web I found a nested map in Firestore is the better way to decrease reads for small data sets.
But the problem is how can I create a Model for nested maps(sometimes require to nested for 4times too)? The below is some sample code of how I want to create nested maps.
String[] backlogs = {"subject1", "subject2", "subject3"};
List<String> logs = Arrays.asList(backlogs);
Map<String, Object> student = new HashMap<>();
student.put("name", STUDENT_NAME);
student.put("id", STUDENT_ID);
student.put("backlogs", logs);
Map<String, Object> sectionA = new HashMap<>();
sectionA.put("students", student);
Map<String, Object> college = new HashMap<>();
college.put("sections", sectionA);
Any suggestions please..