File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,13 @@ declare module 'mongoose' {
274
274
/** Defines an index (most likely compound) for this schema. */
275
275
index ( fields : IndexDefinition , options ?: IndexOptions ) : this;
276
276
277
+ /**
278
+ * Define a search index for this schema.
279
+ *
280
+ * @remarks Search indexes are only supported when used against a 7.0+ Mongo Atlas cluster.
281
+ */
282
+ searchIndex ( description : mongodb . SearchIndexDescription ) : this;
283
+
277
284
/**
278
285
* Returns a list of indexes that this schema declares, via `schema.index()`
279
286
* or by `index: true` in a path's options.
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ declare module 'mongoose' {
24
24
* automatic index builds, you can set autoIndex to false.
25
25
*/
26
26
autoIndex ?: boolean ;
27
+ /**
28
+ * Similar to autoIndex, except for automatically creates any Atlas search indexes defined in your
29
+ * schema. Unlike autoIndex, this option defaults to false.
30
+ */
31
+ autoSearchIndex ?: boolean ;
27
32
/**
28
33
* If set to `true`, Mongoose will call Model.createCollection() to create the underlying collection
29
34
* in MongoDB if autoCreate is set to true. Calling createCollection() sets the collection's default
You can’t perform that action at this time.
0 commit comments