redis/go-redis · error

redis: FILTER_BY_VALUE requires exactly 2 elements [min, max

Error message

redis: FILTER_BY_VALUE requires exactly 2 elements [min, max], got %d

What it means

Error "redis: FILTER_BY_VALUE requires exactly 2 elements [min, max], got %d" thrown in redis/go-redis.

Source

Thrown at timeseries_commands.go:1428

	count int,
	align interface{},
	aggregators [][]Aggregator,
	bucketDuration int,
	bucketTimestamp interface{},
	empty bool,
) ([]interface{}, error) {
	if latest {
		args = append(args, "LATEST")
	}
	if len(filterByTS) > 0 {
		args = append(args, "FILTER_BY_TS")
		for _, ts := range filterByTS {
			args = append(args, ts)
		}
	}
	if len(filterByValue) > 0 {
		if len(filterByValue) != 2 {
			return args, fmt.Errorf("redis: FILTER_BY_VALUE requires exactly 2 elements [min, max], got %d", len(filterByValue))
		}
		args = append(args, "FILTER_BY_VALUE", filterByValue[0], filterByValue[1])
	}
	if count != 0 {
		args = append(args, "COUNT", count)
	}
	if align != nil {
		args = append(args, "ALIGN", align)
	}
	if len(aggregators) > 0 {
		aggParts, err := buildNRangeAggregationArgs(keys, aggregators)
		if err != nil {
			return args, err
		}
		args = append(args, "AGGREGATION")
		for _, a := range aggParts {
			args = append(args, a)
		}

View on GitHub (pinned to c5cad058c7)

When it happens

Trigger: Thrown at timeseries_commands.go:1428 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of redis/go-redis@c5cad058c7 (2026-09-01). Data as JSON: /api/errors/e3a9b643b1c07fa2. Report an issue: GitHub.