Continuously add data to Map
问题 I need to add data to a Map or HashMap before a for...loop, add data to the Map during the for...loop and then create the document with all of the data after the loop. In Java for Android I used: Map<String, Object> createDoc = new HashMap<>(); createDoc.put("type", type); createDoc.put("title", title); for (int x = 0; x < sArray.size(); x++) { createDoc.put("data " + x,sArray.get(x)); } firebaseFirestoreDb.collection("WPS").add(createDoc); My question is, how would I create the document and