From 560f2bfa1864e26cfee6e0f147a9f429fde7535c Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 26 Sep 2018 12:36:46 +0530 Subject: [PATCH] Use countDocuments instead of count fixes #146 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8af68dd..077394e 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,7 @@ function paginate(query, options, callback) { } promises = { docs: docsQuery.exec(), - count: this.count(query).exec() + count: this.countDocuments(query).exec() }; if (lean && leanWithId) { promises.docs = promises.docs.then((docs) => {