This repository was archived by the owner on Feb 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change 10
10
use MongoDB \Builder \Stage ;
11
11
use MongoDB \Tests \Builder \PipelineTestCase ;
12
12
13
- use function MongoDB \object ;
14
-
15
13
/**
16
14
* Test $convert expression
17
15
*/
@@ -43,7 +41,7 @@ public function testExample(): void
43
41
Stage::project (
44
42
totalPrice: Expression::switch (
45
43
branches: [
46
- object (
44
+ Expression:: case (
47
45
case: Expression::eq (
48
46
Expression::type (
49
47
Expression::fieldPath ('convertedPrice ' ),
@@ -52,7 +50,7 @@ public function testExample(): void
52
50
),
53
51
then: 'NaN ' ,
54
52
),
55
- object (
53
+ Expression:: case (
56
54
case: Expression::eq (
57
55
Expression::type (
58
56
Expression::fieldPath ('convertedQty ' ),
Original file line number Diff line number Diff line change 10
10
use MongoDB \Builder \Stage ;
11
11
use MongoDB \Tests \Builder \PipelineTestCase ;
12
12
13
- use function MongoDB \object ;
14
-
15
13
/**
16
14
* Test $isNumber expression
17
15
*/
@@ -28,35 +26,35 @@ public function testConditionallyModifyFieldsUsingIsNumber(): void
28
26
then: Expression::fieldPath ('grade ' ),
29
27
else: Expression::switch (
30
28
branches: [
31
- object (
29
+ Expression:: case (
32
30
case: Expression::eq (
33
31
Expression::fieldPath ('grade ' ),
34
32
'A ' ,
35
33
),
36
34
then: 4 ,
37
35
),
38
- object (
36
+ Expression:: case (
39
37
case: Expression::eq (
40
38
Expression::fieldPath ('grade ' ),
41
39
'B ' ,
42
40
),
43
41
then: 3 ,
44
42
),
45
- object (
43
+ Expression:: case (
46
44
case: Expression::eq (
47
45
Expression::fieldPath ('grade ' ),
48
46
'C ' ,
49
47
),
50
48
then: 2 ,
51
49
),
52
- object (
50
+ Expression:: case (
53
51
case: Expression::eq (
54
52
Expression::fieldPath ('grade ' ),
55
53
'D ' ,
56
54
),
57
55
then: 1 ,
58
56
),
59
- object (
57
+ Expression:: case (
60
58
case: Expression::eq (
61
59
Expression::fieldPath ('grade ' ),
62
60
'F ' ,
Original file line number Diff line number Diff line change 9
9
use MongoDB \Builder \Stage ;
10
10
use MongoDB \Tests \Builder \PipelineTestCase ;
11
11
12
- use function MongoDB \object ;
13
-
14
12
/**
15
13
* Test $toBool expression
16
14
*/
@@ -22,14 +20,14 @@ public function testExample(): void
22
20
Stage::addFields (
23
21
convertedShippedFlag: Expression::switch (
24
22
branches: [
25
- object (
23
+ Expression:: case (
26
24
case: Expression::eq (
27
25
Expression::fieldPath ('shipped ' ),
28
26
'false ' ,
29
27
),
30
28
then: false ,
31
29
),
32
- object (
30
+ Expression:: case (
33
31
case: Expression::eq (
34
32
Expression::fieldPath ('shipped ' ),
35
33
'' ,
You can’t perform that action at this time.
0 commit comments