Skip to content

Commit

Permalink
Async indexes (#624)
Browse files Browse the repository at this point in the history
* Minor deps update

* Updated package version, api & prepublish script

* Added "ensure index async"

* Async ensureNoIndex

* Added deprecation notice
  • Loading branch information
Albinutte authored Jan 14, 2025
1 parent b0bf537 commit 03e43f9
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 129 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,24 @@ Collection.ensureIndex(selector, options);
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`.
```js
Collection.ensureIndexAsync(selector, options);
```
Similar to `ensureIndex`, but returns a Promise that is resolved when the index is created. This method is compatible with Meteor 3.0.
```js
Collection.ensureNoIndex(selector);
```
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.
```js
Collection.ensureNoIndexAsync(selector);
```
Similar to `ensureNoIndex`, but returns a Promise that is resolved when the index is dropped. This method is compatible with Meteor 3.0.
```js
Collection.aggregate(pipeline, ?options);
```
Expand Down
Loading

0 comments on commit 03e43f9

Please sign in to comment.