From 0ea674b95527518f2ec612bfffc0b54a1bb6291f Mon Sep 17 00:00:00 2001 From: vovastelmashchuk Date: Fri, 20 Sep 2024 18:08:53 +0300 Subject: [PATCH] fixed sort --- database/filetrs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/filetrs.js b/database/filetrs.js index 9fd982e..f53c702 100644 --- a/database/filetrs.js +++ b/database/filetrs.js @@ -109,7 +109,7 @@ async function getCocktailSubsetByFilter(filters, skip, limit, sortType = 'most- const sortStage = { $sort: sortType === 'most-popular' ? { visitCount: -1 } - : { ratingScore: -1 } + : { ratingScore: -1, ratingCount: -1, visitCount: -1 } }; const projectStage = {