Skip to content

Commit

Permalink
fix: Improve paginateQuery helper (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Gabilan committed Nov 24, 2023
1 parent df34627 commit 5d7f74e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/modules/paginateCursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports.paginateQuery = async (
aggregateOptions = {},
count = null
) => {
if (!count) {
if (count === null) {
const isAggregation = Array.isArray(query);
if (!isAggregation) {
count = await collectionConnection.countDocuments(query, { allowDiskUse: true, ...countDocumentOptions });
Expand Down

0 comments on commit 5d7f74e

Please sign in to comment.