|
@@ -387,6 +387,10 @@ class MongodbHandler:
|
|
|
else:
|
|
|
data = self._database[collection_name].find({attribute: {comparison_operator: attribute_value}}, {'_id': return_id}).sort(sort_label, direction).limit(limit)
|
|
|
|
|
|
+ if len(list(data)) == 0:
|
|
|
+ self._log.warning('No data was found for the query')
|
|
|
+ return None
|
|
|
+
|
|
|
except Exception as error:
|
|
|
self._log.log_and_raise_error(('An error occured trying to query data from {}, \nError:{}').format(collection_name, error))
|
|
|
|