{"record":{"id":"1eaab129baad5af8","repo":"mikefarah/yq","slug":"all-only-supports-arrays-was-v","errorCode":null,"errorMessage":"all only supports arrays, was %v","messagePattern":"all only supports arrays, was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/operator_booleans.go","lineNumber":91,"sourceCode":"\t\t\t\t// no results found, ignore this entry\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif isTruthyNode(node) == wantBool {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\nfunc allOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {\n\tvar results = list.New()\n\n\tfor el := context.MatchingNodes.Front(); el != nil; el = el.Next() {\n\t\tcandidate := el.Value.(*CandidateNode)\n\t\tif candidate.Kind != SequenceNode {\n\t\t\treturn Context{}, fmt.Errorf(\"all only supports arrays, was %v\", candidate.Tag)\n\t\t}\n\t\tbooleanResult, err := findBoolean(false, d, context, expressionNode.RHS, candidate)\n\t\tif err != nil {\n\t\t\treturn Context{}, err\n\t\t}\n\t\tresult := createBooleanCandidate(candidate, !booleanResult)\n\t\tresults.PushBack(result)\n\t}\n\treturn context.ChildContext(results), nil\n}\n\nfunc anyOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {\n\tvar results = list.New()\n\n\tfor el := context.MatchingNodes.Front(); el != nil; el = el.Next() {\n\t\tcandidate := el.Value.(*CandidateNode)\n\t\tif candidate.Kind != SequenceNode {\n\t\t\treturn Context{}, fmt.Errorf(\"any only supports arrays, was %v\", candidate.Tag)","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/operator_booleans.go#L73-L109","documentation":"The all operator iterates context.MatchingNodes and requires every matched node to be a SequenceNode, because it evaluates its predicate expression against each element. A matched node of any other kind (tag shown in the message, e.g. !!map or !!str) makes 'all' meaningless, so it errors out immediately.","triggerScenarios":"Thrown at pkg/yqlib/operator_booleans.go:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply all only to array nodes, e.g. .items | all(... > 3)","Wrap the value: [ .foo ] | all(...) if a single-element check is wanted","Check for nulls/empties upstream and handle them before all","Use any/all on .[] collected results: [ .[] | ... ] | all(...)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}