fix(db-mongodb): totalDocs with joins (#9056)
### What? Fixes issue with incorrect `totalDocs` value when an aggregation is used for `find`. Previously, `limit: 5` for example always returned `totalDocs: 5`. ### Why? `totalDocs` must be returned correctly. ### How? Removes `$limit` from the pipeline, as `Model.aggregatePaginate` handles it by itself.
This commit is contained in:
@@ -118,7 +118,6 @@ export const find: Find = async function find(
|
||||
collection,
|
||||
collectionConfig,
|
||||
joins,
|
||||
limit,
|
||||
locale,
|
||||
query,
|
||||
})
|
||||
|
||||
@@ -115,7 +115,6 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
|
||||
collection,
|
||||
collectionConfig,
|
||||
joins,
|
||||
limit,
|
||||
locale,
|
||||
projection,
|
||||
query: versionQuery,
|
||||
|
||||
Reference in New Issue
Block a user