|
@@ -521,6 +521,18 @@ class MongodbHandler:
|
|
return [value[query_label] for value in data]
|
|
return [value[query_label] for value in data]
|
|
else:
|
|
else:
|
|
return []
|
|
return []
|
|
|
|
+
|
|
|
|
+ def get_distinct_value_of_key(self, collection_name: str, key: str):
|
|
|
|
+
|
|
|
|
+ assert(isinstance(collection_name, str)),\
|
|
|
|
+ "Parameter 'collection_name' must be a string type"
|
|
|
|
+
|
|
|
|
+ assert(isinstance(key, str)),\
|
|
|
|
+ "Parameter 'key' must be a string type"
|
|
|
|
+
|
|
|
|
+ data = self._database[collection_name].distinct(key)
|
|
|
|
+
|
|
|
|
+ return data
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|