From 5bcd66c0a63261bb15b3043e7ed07a74d7734cfc Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Tue, 31 Dec 2019 09:55:03 +0700 Subject: [PATCH] estimatedDocumentCount to improve getReward api --- apis/candidates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/candidates.js b/apis/candidates.js index c9745edd..6b365169 100644 --- a/apis/candidates.js +++ b/apis/candidates.js @@ -689,7 +689,7 @@ router.get('/:candidate/:owner/getRewards', [ skip = (page) ? limit * (page - 1) : 0 let masternodesRW = [] - const total = db.Status.countDocuments({ + const total = db.Status.estimatedDocumentCount({ candidate: candidate, epoch: { $lte: currentEpoch - 2