Hello,
I am trying to populate a storage through Java. I can update and do all that no issues.
However When I tried to add new docs to new storage, the output shows that everything is succesfull. Even when I fetch all documents, it get returned. But if I fetch by key or I even view in the dashboard, it is empyt Collection. Infact, when I delete that specific collection from the dashboard it stays visible in the list and empty.
StorageService storageService = serviceAPI.buildStorageService();
for(int i =1; i <= 10; i++){
JSONObject jsonDoc = new JSONObject();
JSONArray jsonArr = new JSONArray(); // empty array
String teamName = "Team"+i;
try {
jsonDoc.put("TeamName", teamName);
jsonDoc.put("Members", jsonArr);
} catch (JSONException e) {
e.printStackTrace();
continue;
}
Storage storage = storageService.insertJSONDocument(dbName, collectionName_teams, jsonDoc);
System.out.println("dbName is " + storage.getDbName());
System.out.println("collection Name is " + storage.getCollectionName());
ArrayList<Storage.JSONDocument> jsonDocList = storage.getJsonDocList();
for (int j = 0; j < jsonDocList.size(); j++) {
System.out.println("objectId is " + jsonDocList.get(j).getDocId());
System.out.println("CreatedAt is " + jsonDocList.get(j).getCreatedAt());
System.out.println("UpdatedAtis " + jsonDocList.get(j).getUpdatedAt());
System.out.println("Jsondoc is " + jsonDocList.get(j).getJsonDoc());
}
}
What could be wrong here? I can email you specific details if needed
Thanks