* Creates multiple indexes in the collection, this method is only supported for * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported * error. * * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specification
(
indexSpecs: IndexDescription[],
options?: CreateIndexesOptions
)
| 682 | * ``` |
| 683 | */ |
| 684 | async createIndexes( |
| 685 | indexSpecs: IndexDescription[], |
| 686 | options?: CreateIndexesOptions |
| 687 | ): Promise<string[]> { |
| 688 | return await executeOperation( |
| 689 | this.client, |
| 690 | CreateIndexesOperation.fromIndexDescriptionArray( |
| 691 | this, |
| 692 | this.collectionName, |
| 693 | indexSpecs, |
| 694 | resolveOptions(this, { ...options, maxTimeMS: undefined }) |
| 695 | ) |
| 696 | ); |
| 697 | } |
| 698 | |
| 699 | /** |
| 700 | * Drops an index from this collection. |
no test coverage detected