From 9f1c24c6cc1dd00a6690e54f386eaec392108f4c Mon Sep 17 00:00:00 2001 From: Reouven Mimoun <37777368+mreouven@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:34:40 +0300 Subject: [PATCH 1/2] Update pipelinestage.d.ts Add search meta --- types/pipelinestage.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/pipelinestage.d.ts b/types/pipelinestage.d.ts index 41b0f863be9..28d1188bb13 100644 --- a/types/pipelinestage.d.ts +++ b/types/pipelinestage.d.ts @@ -28,6 +28,7 @@ declare module 'mongoose' { | PipelineStage.ReplaceWith | PipelineStage.Sample | PipelineStage.Search + | PipelineStage.SearchMeta | PipelineStage.Set | PipelineStage.SetWindowFields | PipelineStage.Skip @@ -239,6 +240,20 @@ declare module 'mongoose' { } } + export interface SearchMeta { + /** [`$search` reference](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/) */ + $searchMeta: { + index?: string; + highlight?: { + /** [`highlightPath` reference](https://docs.atlas.mongodb.com/atlas-search/path-construction/#multiple-field-search) */ + path: string | string[] | { value: string, multi: string }; + maxCharsToExamine?: number; + maxNumPassages?: number; + }; + [operator: string]: any; + } + } + export interface Set { /** [`$set` reference](https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/) */ $set: Record From f44e1699e9826c519886ddeeb7544ae94658ab9a Mon Sep 17 00:00:00 2001 From: Reouven Mimoun <37777368+mreouven@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:39:08 +0300 Subject: [PATCH 2/2] Update pipelinestage.d.ts --- 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 28d1188bb13..1e6007cd24e 100644 --- a/types/pipelinestage.d.ts +++ b/types/pipelinestage.d.ts @@ -241,7 +241,7 @@ declare module 'mongoose' { } export interface SearchMeta { - /** [`$search` reference](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/) */ + /** [`$searchMeta` reference](https://www.mongodb.com/docs/atlas/atlas-search/query-syntax/#mongodb-pipeline-pipe.-searchMeta) */ $searchMeta: { index?: string; highlight?: {