Browse Source

add generics

Yuki Takei 2 years ago
parent
commit
e0e923144c

+ 1 - 1
packages/remark-lsx/src/server/routes/list-pages/get-toppage-viewers-count.ts

@@ -4,7 +4,7 @@ import { model } from 'mongoose';
 export const getToppageViewersCount = async(): Promise<number> => {
   const Page = model<IPage>('Page');
 
-  const aggRes = await Page.aggregate([
+  const aggRes = await Page.aggregate<{ count: number }>([
     { $match: { path: '/' } },
     { $project: { count: { $size: '$seenUsers' } } },
   ]);