Skip to content
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

Support _id aggregation operators for $group stage #3096

Merged
merged 19 commits into from
Jul 26, 2023
Prev Previous commit
Next Next commit
fix
  • Loading branch information
noisersup committed Jul 25, 2023
commit cc7ae1699122907f8ac0c0d054ed62197cec639b
4 changes: 2 additions & 2 deletions integration/aggregate_documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestAggregateGroupErrors(t *testing.T) {
err: &mongo.CommandError{
Code: 9,
Name: "FailedToParse",
Message: "Invalid $group :: caused by :: empty variable names are not allowed",
Message: "empty variable names are not allowed",
},
},
"SumDollarVariable": {
Expand All @@ -179,7 +179,7 @@ func TestAggregateGroupErrors(t *testing.T) {
err: &mongo.CommandError{
Code: 9,
Name: "FailedToParse",
Message: "Invalid $group :: caused by :: '$' starts with an invalid character for a user variable name",
Message: "'$' starts with an invalid character for a user variable name",
},
},
"GroupRecursiveNonExistentOperator": {
Expand Down
4 changes: 2 additions & 2 deletions internal/handlers/common/aggregations/stages/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func processOperatorError(err error) error {
case aggregations.ErrInvalidExpression:
return commonerrors.NewCommandErrorMsgWithArgument(
commonerrors.ErrFailedToParse,
"Invalid $group :: caused by :: '$' starts with an invalid character for a user variable name",
"'$' starts with an invalid character for a user variable name",
"$group (stage)",
)
chilagrow marked this conversation as resolved.
Show resolved Hide resolved
case aggregations.ErrEmptyFieldPath:
Expand All @@ -384,7 +384,7 @@ func processOperatorError(err error) error {
case aggregations.ErrEmptyVariable:
return commonerrors.NewCommandErrorMsgWithArgument(
commonerrors.ErrFailedToParse,
"Invalid $group :: caused by :: empty variable names are not allowed",
"empty variable names are not allowed",
"$group (stage)",
)
chilagrow marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down