From aa06f1d25673cbf2bd6bf683ae24f944cece0239 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 22 Nov 2022 16:45:50 +0100 Subject: [PATCH 1/2] fix(types): Update replaceWith pipeline stage --- 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 f58e4b61f27..c3ee2f0a168 100644 --- a/types/pipelinestage.d.ts +++ b/types/pipelinestage.d.ts @@ -213,7 +213,7 @@ declare module 'mongoose' { export interface ReplaceWith { /** [`$replaceWith` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/) */ - $replaceWith: ObjectExpressionOperator | { [field: string]: Expression }; + $replaceWith: ObjectExpressionOperator | { [field: string]: Expression } | `${string}`; } export interface Sample { From 616ce5dedf47a1ece96161a3b714e4c3ebbbad15 Mon Sep 17 00:00:00 2001 From: Eliott C Date: Tue, 22 Nov 2022 16:48:07 +0100 Subject: [PATCH 2/2] Correctly prefix with $ --- 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 c3ee2f0a168..37d228ff1b7 100644 --- a/types/pipelinestage.d.ts +++ b/types/pipelinestage.d.ts @@ -213,7 +213,7 @@ declare module 'mongoose' { export interface ReplaceWith { /** [`$replaceWith` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/) */ - $replaceWith: ObjectExpressionOperator | { [field: string]: Expression } | `${string}`; + $replaceWith: ObjectExpressionOperator | { [field: string]: Expression } | `$${string}`; } export interface Sample {