Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(schema): re-export the defintion for SearchIndexDescription #14464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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