|
@@ -444,12 +444,14 @@ class MongodbHandler:
|
|
try:
|
|
try:
|
|
|
|
|
|
if attribute == None or attribute_value == None:
|
|
if attribute == None or attribute_value == None:
|
|
- data = self._database[collection_name].find({},{'_id': return_id}).sort(sort_label, direction).limit(limit)
|
|
|
|
|
|
+ query = {}
|
|
|
|
+ data = self._database[collection_name].find(query,{'_id': return_id}).sort(sort_label, direction).limit(limit)
|
|
else:
|
|
else:
|
|
- data = self._database[collection_name].find({attribute: {comparison_operator: attribute_value}}, {'_id': return_id}).sort(sort_label, direction).limit(limit)
|
|
|
|
|
|
+ query = {attribute: {comparison_operator: attribute_value}}
|
|
|
|
+ data = self._database[collection_name].find(query, {'_id': return_id}).sort(sort_label, direction).limit(limit)
|
|
|
|
|
|
print('THIS IS THE DATA', list(data))
|
|
print('THIS IS THE DATA', list(data))
|
|
- if len(list(data)) == 0:
|
|
|
|
|
|
+ if data.collection.count_documents(query) == 0:
|
|
self._log.warning('No data was found for the query')
|
|
self._log.warning('No data was found for the query')
|
|
return None
|
|
return None
|
|
|
|
|