+ public ArrayList<HashMap<Object, Object>> readResourceAboutDid(String di, String tableName) {
+ MongoCollection<Document> collection = db.getCollection(tableName);
+ ArrayList<HashMap<Object, Object>> resList = null;
+ MongoCursor<Document> cursor = collection
+ .find(Filters.eq(Constants.DEVICE_ID, di))
+ .iterator();
+
+ if (cursor.hasNext()) {
+ resList = new ArrayList<>();
+ try {
+ while (cursor.hasNext()) {
+ Document doc = cursor.next();
+ resList.add(convertDocumentToHashMap(doc));
+ }
+ } finally {
+ cursor.close();
+ }
+ }
+
+ return resList;
+ }
+