Skip to content

Commit a9e27ab

Browse files
committed
fix 'count' aggregator bug
1 parent b03750f commit a9e27ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

engine/aggregate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ func aggrigate(query gjson.Result) string {
112112
}
113113

114114
case 5:
115-
val.ForEach(func(opr, fld gjson.Result) bool { // opperation & field name
115+
// opr operation, fld field name
116+
val.ForEach(func(opr, fld gjson.Result) bool {
116117

117118
switch opr.Str {
118119
case "$count":
119-
fmt.Println("item is ", _id)
120120
counted := count(fld.Str, data)
121121
for _id, count := range counted {
122122
mapData[_id], _ = sjson.Set(mapData[_id], key.Str, count)

0 commit comments

Comments
 (0)