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
wip
  • Loading branch information
noisersup committed Jul 25, 2023
commit df2d2db3e69b414d7857923dc09e7ffeb509f2c9
2 changes: 1 addition & 1 deletion integration/aggregate_documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestAggregateGroupErrors(t *testing.T) {
"SumEmptyExpression": {
pipeline: bson.A{
bson.D{{"$group", bson.D{
{"sum", bson.D{{"$sum", "$"}}},
{"_id", bson.D{{"$sum", "$"}}},
}}},
},
err: &mongo.CommandError{
Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/common/aggregations/stages/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func processOperatorError(err error) error {
case aggregations.ErrEmptyFieldPath:
return commonerrors.NewCommandErrorMsgWithArgument(
commonerrors.ErrGroupInvalidFieldPath,
"Invalid $group :: caused by :: '$' by itself is not a valid FieldPath",
"'$' by itself is not a valid FieldPath",
"$group (stage)",
)
case aggregations.ErrUndefinedVariable:
Expand Down