Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 0fa04ac

Browse files
committed
Add parameters to $collStats
1 parent b835a98 commit 0fa04ac

File tree

4 files changed

+63
-27
lines changed

4 files changed

+63
-27
lines changed

generator/config/stage/collStats.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,30 @@ name: $collStats
33
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/'
44
type:
55
- stage
6-
encode: single
6+
encode: object
77
description: |
88
Returns statistics regarding a collection or view.
99
arguments:
1010
-
11-
name: config
11+
name: latencyStats
1212
type:
1313
- object
14+
optional: true
15+
-
16+
name: storageStats
17+
type:
18+
- object
19+
optional: true
20+
-
21+
name: count
22+
type:
23+
- object # empty object
24+
optional: true
25+
-
26+
name: queryExecStats
27+
type:
28+
- object # empty object
29+
optional: true
1430
tests:
1531
-
1632
name: 'latencyStats Document'

src/Builder/Stage/CollStatsStage.php

Lines changed: 27 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Stage/FactoryTrait.php

Lines changed: 13 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Builder/Stage/CollStatsStageTest.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ public function testCountField(): void
1919
{
2020
$pipeline = new Pipeline(
2121
Stage::collStats(
22-
object(
23-
count: object(),
24-
),
22+
count: object(),
2523
),
2624
);
2725

@@ -32,10 +30,8 @@ public function testLatencyStatsDocument(): void
3230
{
3331
$pipeline = new Pipeline(
3432
Stage::collStats(
35-
object(
36-
latencyStats: object(
37-
histograms: true,
38-
),
33+
latencyStats: object(
34+
histograms: true,
3935
),
4036
),
4137
);
@@ -47,9 +43,7 @@ public function testQueryExecStatsDocument(): void
4743
{
4844
$pipeline = new Pipeline(
4945
Stage::collStats(
50-
object(
51-
queryExecStats: object(),
52-
),
46+
queryExecStats: object(),
5347
),
5448
);
5549

@@ -60,9 +54,7 @@ public function testStorageStatsDocument(): void
6054
{
6155
$pipeline = new Pipeline(
6256
Stage::collStats(
63-
object(
64-
storageStats: object(),
65-
),
57+
storageStats: object(),
6658
),
6759
);
6860

0 commit comments

Comments
 (0)