Sort fetched nodes by creation date

This commit is contained in:
2016-05-04 18:28:45 +02:00
parent 0b1664a83c
commit ffa98d72e6

View File

@@ -29,7 +29,7 @@ def latest_nodes(db_filter, projection, py_filter, limit):
proj.update(projection)
latest = keep_fetching(nodes, db_filter, proj,
[('_updated', pymongo.DESCENDING)],
[('_created', pymongo.DESCENDING)],
py_filter, limit)
result = list(itertools.islice(latest, limit))