From 2800d2fb2e264e3e5f13bf578ea19d25e8226d82 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 4 Oct 2024 23:35:00 -0400 Subject: [PATCH] sorting now default starting with most recently created --- middleware/advancedResults.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/advancedResults.js b/middleware/advancedResults.js index c1a19ae..63ff53a 100644 --- a/middleware/advancedResults.js +++ b/middleware/advancedResults.js @@ -162,7 +162,7 @@ const advancedResults = (model, populate) => async (req, res, next) => { const sortBy = req.query.sort.split(',').join(' ') query = query.sort(sortBy) } else { - query = query.sort('series title') + query = query.sort('-createDate series title') } // Pagination