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

Method createIndex

src/db.ts:450–460  ·  view source on GitHub ↗

* Creates an index on the db and collection. * * @param name - Name of the collection to create the index on. * @param indexSpec - Specify the field to index, or an index specification * @param options - Optional settings for the command

(
    name: string,
    indexSpec: IndexSpecification,
    options?: CreateIndexesOptions
  )

Source from the content-addressed store, hash-verified

448 * @param options - Optional settings for the command
449 */
450 async createIndex(
451 name: string,
452 indexSpec: IndexSpecification,
453 options?: CreateIndexesOptions
454 ): Promise<string> {
455 const indexes = await executeOperation(
456 this.client,
457 CreateIndexesOperation.fromIndexSpecification(this, name, indexSpec, options)
458 );
459 return indexes[0];
460 }
461
462 /**
463 * Remove a user from a database

Callers 15

operations.tsFile · 0.45
index.jsFile · 0.45
gridfs.test.tsFile · 0.45
collection.test.tsFile · 0.45
find.test.tsFile · 0.45
insert.test.tsFile · 0.45
bulk.test.tsFile · 0.45

Calls 2

executeOperationFunction · 0.90

Tested by

no test coverage detected