diff --git a/types/models.d.ts b/types/models.d.ts index 946121823fc..caa4ea62696 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -245,6 +245,10 @@ declare module 'mongoose' { */ createCollection(options?: mongodb.CreateCollectionOptions & Pick): Promise>; + /** + * Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + */ createSearchIndex(description: mongodb.SearchIndexDescription): Promise; /** Connection the model uses. */ @@ -300,6 +304,10 @@ declare module 'mongoose' { 'deleteOne' >; + /** + * Delete an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) by name. + * This function only works when connected to MongoDB Atlas. + */ dropSearchIndex(name: string): Promise; /** @@ -477,6 +485,10 @@ declare module 'mongoose' { doc: any, options: PopulateOptions | Array | string ): Promise>; + /** + * Update an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/). + * This function only works when connected to MongoDB Atlas. + */ updateSearchIndex(name: string, definition: AnyObject): Promise; /** Casts and validates the given object against this model's schema, passing the given `context` to custom validators. */