fix: incorrectly return totalDocs=1 instead of the correct count when pagination=false

This commit is contained in:
Richard van Heuven van Staereling
2023-06-07 23:36:59 +02:00
parent acf2564c73
commit 2e73938534

View File

@@ -134,7 +134,6 @@ async function find<T extends TypeWithID & Record<string, unknown>>(
leanWithId: true,
useEstimatedCount,
pagination: usePagination,
useCustomCountFn: pagination ? undefined : () => Promise.resolve(1),
options: {
// limit must also be set here, it's ignored when pagination is false
limit: limitToUse,