Fix count expr function when typed values are used
This commit is contained in:
@@ -105,6 +105,10 @@ func count(arr interface{}, v ...interface{}) (count int, err error) {
|
||||
arr = UntypedValue(arr)
|
||||
|
||||
if stv, is := arr.([]TypedValue); is {
|
||||
if len(v) == 0 {
|
||||
return len(stv), nil
|
||||
}
|
||||
|
||||
for _, vv := range v {
|
||||
if occ, err := find(stv, vv); err != nil {
|
||||
return 0, err
|
||||
|
||||
Reference in New Issue
Block a user