You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensures an index exists. Similar to the built-in `createIndex`, but handles the case where the index already exists with different options by removing and re-adding the index with the new options. To ensure your database has the same indexes across different environments, you might want to add `ensureIndex` calls to `Meteor.startup`.
44
44
45
+
```js
46
+
Collection.ensureIndexAsync(selector, options);
47
+
```
48
+
49
+
Similar to `ensureIndex`, but returns a Promise that is resolved when the index is created. This method is compatible with Meteor 3.0.
50
+
45
51
```js
46
52
Collection.ensureNoIndex(selector);
47
53
```
48
54
49
55
The reverse of `ensureIndex`. You might want to call this in `Meteor.startup` to make sure an index has been removed in all of your deployed environments.
50
56
57
+
```js
58
+
Collection.ensureNoIndexAsync(selector);
59
+
```
60
+
61
+
Similar to `ensureNoIndex`, but returns a Promise that is resolved when the index is dropped. This method is compatible with Meteor 3.0.
0 commit comments