|
|
@@ -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' } } },
|
|
|
]);
|