|
@@ -540,6 +540,15 @@ class MongodbHandler:
|
|
data = self._database[collection_name].distinct(key)
|
|
data = self._database[collection_name].distinct(key)
|
|
|
|
|
|
return data
|
|
return data
|
|
|
|
+
|
|
|
|
+ def get_number_of_entries_in_collection(self, collection_name: str):
|
|
|
|
+
|
|
|
|
+ assert(isinstance(collection_name, str)),\
|
|
|
|
+ "Parameter 'collection_name' must be a string type"
|
|
|
|
+
|
|
|
|
+ data = self._database[collection_name].count()
|
|
|
|
+
|
|
|
|
+ return data
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|