diff --git a/attract/__init__.py b/attract/__init__.py index 333cf09..fa2bdaa 100644 --- a/attract/__init__.py +++ b/attract/__init__.py @@ -218,7 +218,7 @@ class AttractExtension(PillarExtension): 'context_object': node_id}, ], }, - 'sort': [('_created', -1)], + 'sort': [('_id', 1)], # Sort by creation, _id is incremental. 'max_results': max_results, 'page': page, }, api=api) diff --git a/attract/routes.py b/attract/routes.py index 0af7833..2521694 100644 --- a/attract/routes.py +++ b/attract/routes.py @@ -51,7 +51,7 @@ def index(): 'where': { 'project': {'$in': list(id_to_proj.keys())}, }, - 'sort': [('_created', -1)], + 'sort': [('_id', 1)], # Sort by creation, _id is incremental. 'max_results': 20, }, api=api)