Always sort telemetry feed

This commit is contained in:
Itay Mizeretz 2018-01-19 11:19:49 +02:00
parent a5eaea8796
commit a76cf7e3f8
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ class TelemetryFeed(flask_restful.Resource):
telemetries = mongo.db.telemetry.find({}) telemetries = mongo.db.telemetry.find({})
else: else:
telemetries = mongo.db.telemetry.find({'timestamp': {'$gt': dateutil.parser.parse(timestamp)}})\ telemetries = mongo.db.telemetry.find({'timestamp': {'$gt': dateutil.parser.parse(timestamp)}})\
.sort([('timestamp', flask_pymongo.ASCENDING)])
telemetries = telemetries.sort([('timestamp', flask_pymongo.ASCENDING)])
return \ return \
{ {