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' {
274274 /** Defines an index (most likely compound) for this schema. */
275275 index ( fields : IndexDefinition , options ?: IndexOptions ) : this;
276276
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+
277284 /**
278285 * Returns a list of indexes that this schema declares, via `schema.index()`
279286 * 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' {
2424 * automatic index builds, you can set autoIndex to false.
2525 */
2626 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 ;
2732 /**
2833 * If set to `true`, Mongoose will call Model.createCollection() to create the underlying collection
2934 * 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