(
options?: IndexInformationOptions
)
| 909 | ): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>; |
| 910 | indexes(options?: ListIndexesOptions): Promise<IndexDescriptionInfo[]>; |
| 911 | async indexes( |
| 912 | options?: IndexInformationOptions |
| 913 | ): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]> { |
| 914 | const indexes: IndexDescriptionInfo[] = await this.listIndexes(options).toArray(); |
| 915 | const full = options?.full ?? true; |
| 916 | if (full) { |
| 917 | return indexes; |
| 918 | } |
| 919 | |
| 920 | const object: IndexDescriptionCompact = Object.fromEntries( |
| 921 | indexes.map(({ name, key }) => [name, Object.entries(key)]) |
| 922 | ); |
| 923 | |
| 924 | return object; |
| 925 | } |
| 926 | |
| 927 | /** |
| 928 | * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. |
no test coverage detected