Skip to content

Commit 338ae9f

Browse files
committed
Fix!: updated aggregate paginate model query type
1 parent c64e520 commit 338ae9f

File tree

1 file changed

+3
-1
lines changed
  • plugins/mongoose-aggregate-paginate-v2/types

1 file changed

+3
-1
lines changed

plugins/mongoose-aggregate-paginate-v2/types/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// and LiRen Tu <https://github.com/tuliren> for their contribution
66

77
declare module "mongoose" {
8+
type PrePaginatePipelineStage = PipelineStage | "__PREPAGINATE__";
9+
810
interface CustomLabels<T = string | undefined | boolean> {
911
totalDocs?: T | undefined;
1012
docs?: T | undefined;
@@ -64,7 +66,7 @@ declare module "mongoose" {
6466

6567
interface AggregatePaginateModel<D> extends Model<D> {
6668
aggregatePaginate<T>(
67-
query?: Aggregate<T[]> | PipelineStage[],
69+
query?: Aggregate<T[]> | PrePaginatePipelineStage[],
6870
options?: PaginateOptions,
6971
callback?: (err: any, result: AggregatePaginateResult<T>) => void
7072
): Promise<AggregatePaginateResult<T>>;

0 commit comments

Comments
 (0)