From be0f534a18e1ece737dd2218f13e25ff7ce92305 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Sun, 26 Sep 2021 08:06:17 +0200 Subject: [PATCH] fix: fix document count in admin search --- src/routes/admin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/admin.ts b/src/routes/admin.ts index e1ac145..985a936 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -129,7 +129,7 @@ router.get("/repos", async (req, res) => { page, total: await AnonymizedRepositoryModel.find({ $and: query, - }).estimatedDocumentCount(), + }).countDocuments(), sort, results: await AnonymizedRepositoryModel.find({ $and: query }) .sort(sort) @@ -156,7 +156,7 @@ router.get("/users", async (req, res) => { res.json({ query: query, page, - total: await UserModel.find(query).estimatedDocumentCount(), + total: await UserModel.find(query).countDocuments(), sort, results: await UserModel.find(query) .sort(sort)