@@ -62,6 +62,13 @@ export type EnsureHashIndexOptions = {
6262 * Default: `true`
6363 */
6464 estimates ?: boolean ;
65+ /**
66+ * If set to `true`, the index will be created in the background to reduce
67+ * the write-lock duration for the collection during index creation.
68+ *
69+ * Default: `false`
70+ */
71+ inBackground ?: boolean ;
6572} ;
6673
6774/**
@@ -110,6 +117,13 @@ export type EnsureSkiplistIndexOptions = {
110117 * Default: `true`
111118 */
112119 estimates ?: boolean ;
120+ /**
121+ * If set to `true`, the index will be created in the background to reduce
122+ * the write-lock duration for the collection during index creation.
123+ *
124+ * Default: `false`
125+ */
126+ inBackground ?: boolean ;
113127} ;
114128
115129/**
@@ -149,6 +163,13 @@ export type EnsurePersistentIndexOptions = {
149163 * Default: `true`
150164 */
151165 estimates ?: boolean ;
166+ /**
167+ * If set to `true`, the index will be created in the background to reduce
168+ * the write-lock duration for the collection during index creation.
169+ *
170+ * Default: `false`
171+ */
172+ inBackground ?: boolean ;
152173} ;
153174
154175/**
@@ -174,6 +195,13 @@ export type EnsureGeoIndexOptions =
174195 * A unique name for this index.
175196 */
176197 name ?: string ;
198+ /**
199+ * If set to `true`, the index will be created in the background to reduce
200+ * the write-lock duration for the collection during index creation.
201+ *
202+ * Default: `false`
203+ */
204+ inBackground ?: boolean ;
177205 }
178206 | {
179207 type : "geo" ;
@@ -197,6 +225,13 @@ export type EnsureGeoIndexOptions =
197225 * A unique name for this index.
198226 */
199227 name ?: string ;
228+ /**
229+ * If set to `true`, the index will be created in the background to reduce
230+ * the write-lock duration for the collection during index creation.
231+ *
232+ * Default: `false`
233+ */
234+ inBackground ?: boolean ;
200235 } ;
201236
202237/**
@@ -219,6 +254,13 @@ export type EnsureFulltextIndexOptions = {
219254 * Minimum character length of words to index.
220255 */
221256 minLength ?: number ;
257+ /**
258+ * If set to `true`, the index will be created in the background to reduce
259+ * the write-lock duration for the collection during index creation.
260+ *
261+ * Default: `false`
262+ */
263+ inBackground ?: boolean ;
222264} ;
223265
224266/**
@@ -242,6 +284,13 @@ export type EnsureTtlIndexOptions = {
242284 * be considered as expired.
243285 */
244286 expireAfter : number ;
287+ /**
288+ * If set to `true`, the index will be created in the background to reduce
289+ * the write-lock duration for the collection during index creation.
290+ *
291+ * Default: `false`
292+ */
293+ inBackground ?: boolean ;
245294} ;
246295
247296/**
0 commit comments