Skip to content

Commit f4dc843

Browse files
Merge pull request #25 from chenmingyong0423/feature/build
refactor(aggregation/add): overhaul add function parameter
2 parents 82a7d52 + 60ddaec commit f4dc843

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builder/aggregation/bson_construction_without_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func MaxWithoutKey(expression any) bson.D {
4949
return bson.D{{Key: types.AggregationMax, Value: expression}}
5050
}
5151

52-
func AddWithoutKey(expression any) bson.D {
52+
func AddWithoutKey(expression ...any) bson.D {
5353
return bson.D{{Key: types.AggregationAdd, Value: expression}}
5454
}
5555

builder/aggregation/bson_construction_without_key_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func TestAddWithoutKey(t *testing.T) {
202202

203203
for _, tc := range testCases {
204204
t.Run(tc.name, func(t *testing.T) {
205-
got := AddWithoutKey(tc.expressions)
205+
got := AddWithoutKey(tc.expressions...)
206206
assert.Equal(t, tc.want, got)
207207
})
208208
}

0 commit comments

Comments
 (0)