소스 검색

Sort recipes alphabetically

Lee Morgan 1 개월 전
부모
커밋
0ab8453b96
1개의 변경된 파일과 3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/routes/dashboard/+page.server.js

+ 3 - 2
src/routes/dashboard/+page.server.js

@@ -10,7 +10,8 @@ export async function load({cookies}){
             id: {$toString: "$_id"},
             name: 1,
             updatedAt: 1
-        }}
-    ]);
+        }},
+        {$sort: {name: 1}}
+    ]).collation({locale: "en", strength: 2});
     return {recipes};
 }