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

Commit edd6a1c

Browse files
authored
PHPLIB-1340 Remove Projection Operators (#54)
They can't be used in $project stage as I was expecting. They are dedicated to the find command. The $slice must be used as an expression (with the array as 1st parameter) and $elemMatch is replaced by $filter.
1 parent c0daa64 commit edd6a1c

File tree

19 files changed

+8
-320
lines changed

19 files changed

+8
-320
lines changed

generator/config/definitions.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,4 @@
5656
OperatorTestGenerator::class,
5757
],
5858
],
59-
60-
// Projection Operators
61-
[
62-
'configFiles' => __DIR__ . '/projection',
63-
'namespace' => 'MongoDB\\Builder\\Projection',
64-
'classNameSuffix' => 'Operator',
65-
'generators' => [
66-
OperatorClassGenerator::class,
67-
OperatorFactoryGenerator::class,
68-
OperatorTestGenerator::class,
69-
],
70-
],
7159
];

generator/config/expression/slice.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: $slice
33
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/'
44
type:
55
- resolvesToArray
6-
- projection
76
encode: array
87
description: |
98
Returns a subset of an array.

generator/config/expressions.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@
8989
'returnType' => Type\QueryInterface::class,
9090
'acceptedTypes' => [Type\QueryInterface::class, 'array'],
9191
],
92-
'projection' => [
93-
'returnType' => Type\ProjectionInterface::class,
94-
'acceptedTypes' => [Type\ProjectionInterface::class, ...$bsonTypes['object']],
95-
],
9692
'accumulator' => [
9793
'returnType' => Type\AccumulatorInterface::class,
9894
'acceptedTypes' => [Type\AccumulatorInterface::class, ...$bsonTypes['object']],

generator/config/projection/elemMatch.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

generator/config/projection/filter.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

generator/config/projection/slice.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

generator/config/query/natural.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

generator/config/schema.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"type": "string",
2424
"enum": [
2525
"accumulator",
26-
"projection",
2726
"stage",
2827
"query",
2928
"fieldQuery",
@@ -113,7 +112,6 @@
113112
"window",
114113
"expression",
115114
"geometry",
116-
"projection",
117115
"fieldPath",
118116
"any",
119117
"resolvesToNumber", "numberFieldPath", "number",

generator/config/stage/project.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ arguments:
1111
name: specification
1212
type:
1313
- expression
14-
- projection
1514
variadic: object

src/Builder/Expression/SliceOperator.php

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Builder/Projection/FactoryTrait.php

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

src/Builder/Projection/FilterOperator.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/Builder/Projection/SliceOperator.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Builder/Query/FactoryTrait.php

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

src/Builder/Query/NaturalOperator.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Builder/Stage/FactoryTrait.php

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

0 commit comments

Comments
 (0)