Skip to content

Commit

Permalink
rename match to have,filter group by 'have'
Browse files Browse the repository at this point in the history
  • Loading branch information
baxiry committed Aug 23, 2024
1 parent 1fce8a8 commit 43b94ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,21 @@ func aggrigate(query gjson.Result) string {

default:
message = "opss! something wrrong!"
return false
}

return true
})

mtch := query.Get("gmatch")
have := query.Get("have")

result := "["
for _, val := range mapData {
if ok, _ := match(mtch, val); ok {
if ok, _ := match(have, val); ok {
result += val + ","
}
}

if message != "" {
return message
}
Expand Down

0 comments on commit 43b94ae

Please sign in to comment.