* Returns the options of the collection. * * @param options - Optional settings for the command
(options?: OperationOptions)
| 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 |
no test coverage detected