Merge "Enforce reverse time-order for sample return"
This commit is contained in:
@@ -450,7 +450,9 @@ class Connection(base.Connection):
|
||||
if limit == 0:
|
||||
return
|
||||
q = make_query_from_filter(sample_filter, require_meter=False)
|
||||
samples = self.db.meter.find(q).limit(limit or 0)
|
||||
samples = self.db.meter.find(q, limit=limit,
|
||||
sort=[("timestamp", pymongo.DESCENDING)])
|
||||
|
||||
for s in samples:
|
||||
# Remove the ObjectId generated by the database when
|
||||
# the sample was inserted. It is an implementation
|
||||
|
||||
Reference in New Issue
Block a user