Skip to content

Commit

Permalink
types: add tsdoc comments re: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 13, 2024
1 parent ab28496 commit 33b3bba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions types/models.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ declare module 'mongoose' {
*/
createCollection<T extends mongodb.Document>(options?: mongodb.CreateCollectionOptions & Pick<SchemaOptions, 'expires'>): Promise<mongodb.Collection<T>>;

/**
* 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<string>;

/** Connection the model uses. */
Expand Down Expand Up @@ -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<void>;

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

/**
* 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<void>;

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

0 comments on commit 33b3bba

Please sign in to comment.