Skip to content

Commit 33b3bba

Browse files
committed
types: add tsdoc comments re: code review
1 parent ab28496 commit 33b3bba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

types/models.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ declare module 'mongoose' {
245245
*/
246246
createCollection<T extends mongodb.Document>(options?: mongodb.CreateCollectionOptions & Pick<SchemaOptions, 'expires'>): Promise<mongodb.Collection<T>>;
247247

248+
/**
249+
* Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/).
250+
* This function only works when connected to MongoDB Atlas.
251+
*/
248252
createSearchIndex(description: mongodb.SearchIndexDescription): Promise<string>;
249253

250254
/** Connection the model uses. */
@@ -300,6 +304,10 @@ declare module 'mongoose' {
300304
'deleteOne'
301305
>;
302306

307+
/**
308+
* Delete an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) by name.
309+
* This function only works when connected to MongoDB Atlas.
310+
*/
303311
dropSearchIndex(name: string): Promise<void>;
304312

305313
/**
@@ -477,6 +485,10 @@ declare module 'mongoose' {
477485
doc: any, options: PopulateOptions | Array<PopulateOptions> | string
478486
): Promise<MergeType<THydratedDocumentType, Paths>>;
479487

488+
/**
489+
* Update an existing [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/).
490+
* This function only works when connected to MongoDB Atlas.
491+
*/
480492
updateSearchIndex(name: string, definition: AnyObject): Promise<void>;
481493

482494
/** Casts and validates the given object against this model's schema, passing the given `context` to custom validators. */

0 commit comments

Comments
 (0)