MCPcopy
hub / github.com/mongodb/node-mongodb-native / dropIndexes

Method dropIndexes

src/collection.ts:720–732  ·  view source on GitHub ↗

* Drops all indexes from this collection. * * @param options - Optional settings for the command

(options?: DropIndexesOptions)

Source from the content-addressed store, hash-verified

718 * @param options - Optional settings for the command
719 */
720 async dropIndexes(options?: DropIndexesOptions): Promise<boolean> {
721 try {
722 await executeOperation(
723 this.client,
724 new DropIndexOperation(this as TODO_NODE_3286, '*', resolveOptions(this, options))
725 );
726 return true;
727 } catch (error) {
728 // TODO(NODE-6517): Driver should only filter for namespace not found error. Other errors should be thrown.
729 if (error instanceof MongoOperationTimeoutError) throw error;
730 return false;
731 }
732 }
733
734 /**
735 * Get the list of all indexes information for the collection.

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by

no test coverage detected