Skip to content

Commit 6807a07

Browse files
committed
Fix #728
1 parent 7116fe8 commit 6807a07

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ This driver uses semantic versioning:
3434

3535
- Added `collection.documents` for fetching multiple documents
3636

37+
- Added missing `details` flag to `collection.figures` [#728](https://github.com/arangodb/arangojs/issues/728)
38+
3739
- Added support for `fillBlockCache` query option
3840

3941
- Added User Management API [#664](https://github.com/arangodb/arangojs/issues/664)

src/collection.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,9 @@ export interface DocumentCollection<T extends Record<string, unknown> = any>
13721372
/**
13731373
* Retrieves statistics for a collection.
13741374
*
1375+
* @param details - whether to return extended storage engine-specific details
1376+
* to the figures, which may cause additional load and impact performance
1377+
*
13751378
* @example
13761379
* ```js
13771380
* const db = new Database();
@@ -1380,7 +1383,9 @@ export interface DocumentCollection<T extends Record<string, unknown> = any>
13801383
* // data contains the collection's figures
13811384
* ```
13821385
*/
1383-
figures(): Promise<
1386+
figures(
1387+
details?: boolean
1388+
): Promise<
13841389
ArangoResponseMetadata &
13851390
CollectionMetadata &
13861391
CollectionProperties & { count: number; figures: Record<string, any> }
@@ -3430,14 +3435,19 @@ export class Collection<T extends Record<string, unknown> = any>
34303435
return body.result;
34313436
}
34323437

3433-
figures() {
3434-
return this._get<
3435-
CollectionMetadata &
3436-
CollectionProperties & {
3437-
count: number;
3438-
figures: Record<string, any>;
3439-
}
3440-
>("figures");
3438+
figures(
3439+
details = false
3440+
): Promise<
3441+
CollectionMetadata &
3442+
CollectionProperties & {
3443+
count: number;
3444+
figures: Record<string, any>;
3445+
} & ArangoResponseMetadata
3446+
> {
3447+
return this._db.request({
3448+
path: `/_api/collection/${this._name}/figures`,
3449+
qs: { details },
3450+
});
34413451
}
34423452

34433453
revision() {

0 commit comments

Comments
 (0)