{"record":{"id":"0da31d7f572dc576","repo":"redis/go-redis","slug":"ft-aggregate-loadall-and-load-are-mutually-exclus","errorCode":null,"errorMessage":"FT.AGGREGATE: LOADALL and LOAD are mutually exclusive","messagePattern":"FT\\.AGGREGATE: LOADALL and LOAD are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"search_commands.go","lineNumber":696,"sourceCode":"func (c cmdable) FTAggregate(ctx context.Context, index string, query string) *MapStringInterfaceCmd {\n\targs := []interface{}{\"FT.AGGREGATE\", index, query}\n\tcmd := NewMapStringInterfaceCmd(ctx, args...)\n\t_ = c(ctx, cmd)\n\treturn cmd\n}\n\n// validateFTAggregateOptions validates mutually exclusive combinations of\n// FTAggregateOptions fields before any command arguments are constructed.\nfunc validateFTAggregateOptions(options *FTAggregateOptions) error {\n\tif len(options.Steps) > 0 {\n\t\tif options.Load != nil || options.Apply != nil || options.GroupBy != nil ||\n\t\t\toptions.SortBy != nil || options.SortByMax != 0 {\n\t\t\treturn fmt.Errorf(\"FT.AGGREGATE: Steps cannot be combined with the deprecated Load, Apply, GroupBy, SortBy and SortByMax fields\")\n\t\t}\n\t\tif options.LoadAll {\n\t\t\tfor _, step := range options.Steps {\n\t\t\t\tif step.Load != nil {\n\t\t\t\t\treturn fmt.Errorf(\"FT.AGGREGATE: LOADALL and LOAD are mutually exclusive\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif options.LoadAll && options.Load != nil {\n\t\treturn fmt.Errorf(\"FT.AGGREGATE: LOADALL and LOAD are mutually exclusive\")\n\t}\n\treturn nil\n}\n\n// appendFTAggregateStep appends the Redis command arguments for a single\n// aggregation pipeline step. Each step must set exactly one of Load, Apply,\n// GroupBy or SortBy.\nfunc appendFTAggregateStep(args []interface{}, step FTAggregateStep) ([]interface{}, error) {\n\tset := 0\n\tif step.Load != nil {\n\t\tset++\n\t}","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/search_commands.go#L678-L714","documentation":"Error \"FT.AGGREGATE: LOADALL and LOAD are mutually exclusive\" thrown in redis/go-redis.","triggerScenarios":"Thrown at search_commands.go:696 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}