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

Method options

src/collection.ts:585–596  ·  view source on GitHub ↗

* Returns the options of the collection. * * @param options - Optional settings for the command

(options?: OperationOptions)

Source from the content-addressed store, hash-verified

583 * @param options - Optional settings for the command
584 */
585 async options(options?: OperationOptions): Promise<Document> {
586 options = resolveOptions(this, options);
587 const [collection] = await this.db
588 .listCollections({ name: this.collectionName }, { ...options, nameOnly: false })
589 .toArray();
590
591 if (collection == null || collection.options == null) {
592 throw new MongoAPIError(`collection ${this.namespace} not found`);
593 }
594
595 return collection.options;
596 }
597
598 /**
599 * Returns if the collection is a capped collection

Callers 1

isCappedMethod · 0.95

Calls 3

resolveOptionsFunction · 0.90
toArrayMethod · 0.80
listCollectionsMethod · 0.80

Tested by

no test coverage detected