From 5555919eef83dc3683c667456965f9f44c6ac727 Mon Sep 17 00:00:00 2001 From: Fabio Cingottini Date: Thu, 6 Oct 2022 18:05:19 +0200 Subject: [PATCH] fix(types): adjust replaceWith type pipeline stage replaceWith pipeline stage was not accepting a field as a parameter. This was causing ts error when users where trying to call aggregate method with replaceWith stage in unusual ways --- types/pipelinestage.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pipelinestage.d.ts b/types/pipelinestage.d.ts index 5d3c4023f0d..bbc98324a75 100644 --- a/types/pipelinestage.d.ts +++ b/types/pipelinestage.d.ts @@ -202,7 +202,7 @@ declare module 'mongoose' { export interface ReplaceWith { /** [`$replaceWith` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/) */ - $replaceWith: ObjectExpressionOperator; + $replaceWith: ObjectExpressionOperator | { [field: string]: Expression }; } export interface Sample {