Merge pull request #2791 from no-heroes/fix/pagination-false-totaldocs

fix: totalDocs is always 1 when using payload.find({ pagination: false })
This commit is contained in:
James Mikrut
2023-06-16 16:37:50 -04:00
committed by GitHub
2 changed files with 16 additions and 1 deletions

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,