Skip to content

Commit

Permalink
Merge pull request #14464 from noseworthy/re-export-search-index-desc…
Browse files Browse the repository at this point in the history
…ription

types(schema): re-export the defintion for `SearchIndexDescription`
  • Loading branch information
vkarpov15 committed Mar 26, 2024
2 parents 7f2c56c + 55fde0e commit f3a094f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -279,7 +279,7 @@ declare module 'mongoose' {
*
* @remarks Search indexes are only supported when used against a 7.0+ Mongo Atlas cluster.
*/
searchIndex(description: mongodb.SearchIndexDescription): this;
searchIndex(description: SearchIndexDescription): this;

/**
* Returns a list of indexes that this schema declares, via `schema.index()`
Expand Down
2 changes: 2 additions & 0 deletions types/indexes.d.ts
Expand Up @@ -86,4 +86,6 @@ declare module 'mongoose' {
expires?: number | string;
weights?: Record<string, number>;
}

type SearchIndexDescription = mongodb.SearchIndexDescription;
}
2 changes: 1 addition & 1 deletion types/models.d.ts
Expand Up @@ -327,7 +327,7 @@ declare module 'mongoose' {
* 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>;
createSearchIndex(description: SearchIndexDescription): Promise<string>;

/** Connection the model uses. */
db: Connection;
Expand Down

0 comments on commit f3a094f

Please sign in to comment.