Explorar o código

Change sorting statement back...

ogert %!s(int64=5) %!d(string=hai) anos
pai
achega
125f105bb4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      cdplib/db_handlers/MongodbHandler.py

+ 1 - 1
cdplib/db_handlers/MongodbHandler.py

@@ -446,7 +446,7 @@ class MongodbHandler:
             if attribute == None or attribute_value == None:
                 data = self._database[collection_name].find({},{'_id': return_id}).sort(sort_label, direction).limit(limit)
             else:
-                data = self._database[collection_name].find({attribute: {comparison_operator: attribute_value}}, {'_id': return_id}).sort({sort_label: direction}).limit(limit)
+                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')