-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPLIB-1254 Create Yaml for all operators and stages #1180
Closed
Closed
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
6fe9809
Create Yaml files from Google Sheet
GromNaN 204e88f
Import all operators and stages
GromNaN b3c6279
Add @no-named-argument to list variadic
GromNaN 59f360c
Improve typing for variadics
GromNaN 64ee28e
Add link and description to classes and factory
GromNaN 05c5ee5
Temporary disable benchmarks and old PHP version from CI
GromNaN 83aa77a
Fix & encoding
GromNaN 9a36d17
Fix schema
GromNaN c0de34d
Introduce MongoDB\object() function
GromNaN 70f8671
Fix single encoding + optional value in array
GromNaN 38c7750
Fix psalm + accumulator
GromNaN 5733833
Case insensitive sort of methods
GromNaN 6faa7f8
Fix $sum accumulator test
GromNaN 27c9f21
Ignore psalm issues
GromNaN 502ed6b
Improve doc for object function
GromNaN 3f175e7
Fix methods order
GromNaN d89d024
Remove tests on PHP 8.0
GromNaN 2129f88
Rename mixed to any and remove incorrect generic type from list
GromNaN 06c5294
Improve operator classification and add all BSON types
GromNaN a5840c0
Rename Expression Operators and write architecture document
GromNaN 99e2266
Implement Regex factory
GromNaN 636aa4a
Remove generated warning on non-generated files
GromNaN 5bc3cd8
Add use function for generated code
GromNaN bdfbcc5
Refinement of query type with a new filter type
GromNaN c7bc14c
Move Projection operators to a dedicated namespace
GromNaN 35dbd63
Move Optional & Encode enum to the Type namespace
GromNaN 00b3cd3
Move Accumulator and Window operators in a dedicated namespace
GromNaN dd28e4a
Remove category from Yaml files and remove scrape command
GromNaN 58fd4d0
Add some errors for incorrect types
GromNaN 13d29a8
Rename filter to fieldQuery
GromNaN e51b16f
exclude accumulator from QA
GromNaN c0790e0
Make FieldPath implement ResolveToAny
GromNaN 960eaa4
Remove unused packages
GromNaN 120f530
Make operator classes read-only
GromNaN 57555b9
Add tests on Pipeline class
GromNaN fee0df6
Rename PhpObject enum
GromNaN ad48be4
Use BSON\Type and BSON\Javascript classes, remove duplicate resolveToInt
GromNaN File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# $schema: ../schema.json | ||
name: $accumulator | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/' | ||
type: | ||
- accumulator | ||
encode: object | ||
description: | | ||
Defines a custom accumulator function. | ||
New in version 4.4. | ||
arguments: | ||
- | ||
name: init | ||
type: | ||
- string | ||
description: | | ||
Function used to initialize the state. The init function receives its arguments from the initArgs array expression. You can specify the function definition as either BSON type Code or String. | ||
- | ||
name: initArgs | ||
type: | ||
- resolvesToArray | ||
optional: true | ||
description: | | ||
Arguments passed to the init function. | ||
- | ||
name: accumulate | ||
type: | ||
- string | ||
description: | | ||
Function used to accumulate documents. The accumulate function receives its arguments from the current state and accumulateArgs array expression. The result of the accumulate function becomes the new state. You can specify the function definition as either BSON type Code or String. | ||
- | ||
name: accumulateArgs | ||
type: | ||
- resolvesToArray | ||
description: | | ||
Arguments passed to the accumulate function. You can use accumulateArgs to specify what field value(s) to pass to the accumulate function. | ||
- | ||
name: merge | ||
type: | ||
- string | ||
description: | | ||
Function used to merge two internal states. merge must be either a String or Code BSON type. merge returns the combined result of the two merged states. For information on when the merge function is called, see Merge Two States with $merge. | ||
- | ||
name: finalize | ||
type: | ||
- string | ||
optional: true | ||
description: | | ||
Function used to update the result of the accumulation. | ||
- | ||
name: lang | ||
type: | ||
- string | ||
description: | | ||
The language used in the $accumulator code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# $schema: ../schema.json | ||
name: $addToSet | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/' | ||
type: | ||
- accumulator | ||
- window | ||
encode: single | ||
description: | | ||
Returns an array of unique expression values for each group. Order of the array elements is undefined. | ||
Changed in version 5.0: Available in the $setWindowFields stage. | ||
arguments: | ||
- | ||
name: expression | ||
type: | ||
- expression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# $schema: ../schema.json | ||
name: $avg | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/' | ||
type: | ||
- accumulator | ||
- window | ||
encode: single | ||
description: | | ||
Returns an average of numerical values. Ignores non-numeric values. | ||
Changed in version 5.0: Available in the $setWindowFields stage. | ||
arguments: | ||
- | ||
name: expression | ||
type: | ||
- resolvesToNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# $schema: ../schema.json | ||
name: $bottom | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/' | ||
type: | ||
- accumulator | ||
- window | ||
encode: object | ||
description: | | ||
Returns the bottom element within a group according to the specified sort order. | ||
New in version 5.2: Available in the $group and $setWindowFields stages. | ||
arguments: | ||
- | ||
name: sortBy | ||
type: | ||
- object # SortSpec | ||
description: | | ||
Specifies the order of results, with syntax similar to $sort. | ||
- | ||
name: output | ||
type: | ||
- expression | ||
description: | | ||
Represents the output for each element in the group and can be any expression. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# $schema: ../schema.json | ||
name: $bottomN | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/' | ||
type: | ||
- accumulator | ||
- window | ||
encode: object | ||
description: | | ||
Returns an aggregation of the bottom n elements within a group, according to the specified sort order. If the group contains fewer than n elements, $bottomN returns all elements in the group. | ||
New in version 5.2. | ||
Available in the $group and $setWindowFields stages. | ||
arguments: | ||
- | ||
name: 'n' | ||
type: | ||
- resolvesToInt | ||
description: | | ||
Limits the number of results per group and has to be a positive integral expression that is either a constant or depends on the _id value for $group. | ||
- | ||
name: sortBy | ||
type: | ||
- object # SortSpec | ||
description: | | ||
Specifies the order of results, with syntax similar to $sort. | ||
- | ||
name: output | ||
type: | ||
- expression | ||
description: | | ||
Represents the output for each element in the group and can be any expression. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# $schema: ../schema.json | ||
name: $count | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/count-accumulator/' | ||
type: | ||
- accumulator | ||
- window | ||
encode: object | ||
description: | | ||
Returns the number of documents in the group or window. | ||
Distinct from the $count pipeline stage. | ||
New in version 5.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# $schema: ../schema.json | ||
name: $covariancePop | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/' | ||
type: | ||
- window | ||
encode: array | ||
description: | | ||
Returns the population covariance of two numeric expressions. | ||
New in version 5.0. | ||
arguments: | ||
- | ||
name: expression1 | ||
type: | ||
- resolvesToNumber | ||
- | ||
name: expression2 | ||
type: | ||
- resolvesToNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# $schema: ../schema.json | ||
name: $covarianceSamp | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/' | ||
type: | ||
- window | ||
encode: array | ||
description: | | ||
Returns the sample covariance of two numeric expressions. | ||
New in version 5.0. | ||
arguments: | ||
- | ||
name: expression1 | ||
type: | ||
- resolvesToNumber | ||
- | ||
name: expression2 | ||
type: | ||
- resolvesToNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# $schema: ../schema.json | ||
name: $denseRank | ||
|
||
link: 'https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/' | ||
type: | ||
- window | ||
encode: object | ||
description: | | ||
Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition. There are no gaps in the ranks. Ties receive the same rank. | ||
New in version 5.0. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be reverted by PHPLIB-1268
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you come to a solution to still run PHPLIB against 7.4+ but limit the aggregation builder code to 8.1+?