Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/db-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"dependencies": {
"mongoose": "8.15.1",
"mongoose-paginate-v2": "1.8.5",
"mongoose-paginate-v2": "1.9.4",
"prompts": "2.4.2",
"uuid": "10.0.0"
},
Expand Down
14 changes: 0 additions & 14 deletions packages/db-mongodb/src/queryDrafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,6 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
}),
)
}
} else if (!useEstimatedCount && this.collation) {
// Workaround for mongoose-paginate-v2 bug: chaining .collation() on countDocuments breaks
// session context in transactions (mongoose 8.x). Provide custom count function that passes
// collation as an option instead. See: https://github.com/aravindnc/mongoose-paginate-v2/pull/240
// TODO: Remove this workaround once mongoose-paginate-v2 is updated with the fix.
paginationOptions.useCustomCountFn = () => {
return Promise.resolve(
Model.countDocuments(versionQuery, {
collation: paginationOptions.collation,
session,
}),
)
}
}

if (limit && limit > 0) {
Expand All @@ -158,7 +145,6 @@ export const queryDrafts: QueryDrafts = async function queryDrafts(
versions: true,
})

// build join aggregation
if (aggregate || sortAggregation.length > 0) {
result = await aggregatePaginate({
adapter: this,
Expand Down
Loading
Loading