Skip to content

Commit f3a094f

Browse files
authored
Merge pull request #14464 from noseworthy/re-export-search-index-description
types(schema): re-export the defintion for `SearchIndexDescription`
2 parents 7f2c56c + 55fde0e commit f3a094f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ declare module 'mongoose' {
279279
*
280280
* @remarks Search indexes are only supported when used against a 7.0+ Mongo Atlas cluster.
281281
*/
282-
searchIndex(description: mongodb.SearchIndexDescription): this;
282+
searchIndex(description: SearchIndexDescription): this;
283283

284284
/**
285285
* Returns a list of indexes that this schema declares, via `schema.index()`

types/indexes.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,6 @@ declare module 'mongoose' {
8686
expires?: number | string;
8787
weights?: Record<string, number>;
8888
}
89+
90+
type SearchIndexDescription = mongodb.SearchIndexDescription;
8991
}

types/models.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ declare module 'mongoose' {
327327
* Create an [Atlas search index](https://www.mongodb.com/docs/atlas/atlas-search/create-index/).
328328
* This function only works when connected to MongoDB Atlas.
329329
*/
330-
createSearchIndex(description: mongodb.SearchIndexDescription): Promise<string>;
330+
createSearchIndex(description: SearchIndexDescription): Promise<string>;
331331

332332
/** Connection the model uses. */
333333
db: Connection;

0 commit comments

Comments
 (0)