{"record":{"id":"82bef6b521435378","repo":"n8n-io/n8n","slug":"missing-valuetextarray-for-containsany-operato","errorCode":null,"errorMessage":"Missing 'valueTextArray' for 'containsAny' operator.","messagePattern":"Missing 'valueTextArray' for 'containsAny' operator\\.","errorType":"exception","errorClass":"OperationalError","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.ts","lineNumber":86,"sourceCode":"function buildFilter(filter: WeaviateFilterUnit): FilterValue {\n\tconst { path, operator } = filter;\n\tconst property = weaviate.filter.byProperty(path[0]);\n\n\tswitch (operator.toLowerCase()) {\n\t\tcase 'equal':\n\t\t\tif (filter.valueString !== undefined) return property.equal(filter.valueString);\n\t\t\tif (filter.valueNumber !== undefined) return property.equal(filter.valueNumber);\n\t\t\tbreak;\n\n\t\tcase 'like':\n\t\t\tif (filter.valueString === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueString' for 'like' operator.\");\n\t\t\t}\n\t\t\treturn property.like(filter.valueString);\n\n\t\tcase 'containsany':\n\t\t\tif (filter.valueTextArray === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueTextArray' for 'containsAny' operator.\");\n\t\t\t}\n\t\t\treturn property.containsAny(filter.valueTextArray);\n\n\t\tcase 'containsall':\n\t\t\tif (filter.valueTextArray === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueTextArray' for 'containsAll' operator.\");\n\t\t\t}\n\t\t\treturn property.containsAll(filter.valueTextArray);\n\n\t\tcase 'greaterthan':\n\t\t\tif (filter.valueNumber === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueNumber' for 'greaterThan' operator.\");\n\t\t\t}\n\t\t\treturn property.greaterThan(filter.valueNumber);\n\n\t\tcase 'lessthan':\n\t\t\tif (filter.valueNumber === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueNumber' for 'lessThan' operator.\");","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.ts#L68-L104","documentation":"buildFilter maps the node's filter configuration onto the Weaviate client API. For operator 'containsAny' the required valueTextArray field was not supplied (undefined), so the containsAny clause cannot be constructed and an OperationalError names the missing field.","triggerScenarios":"Filter unit shaped { operator: 'containsany', path: [...], /* valueTextArray missing */ } reaches buildFilter.","commonSituations":"Array value left empty or sourced from an expression that resolved to undefined; JSON filter missing the valueTextArray key; caller assumed a default empty array.","solutions":["Supply a non-empty valueTextArray: { operator: 'containsAny', path: ['tags'], valueTextArray: ['a','b'] }.","Drop the filter unit if no array is available; containsAny with nothing is not meaningful.","Pre-validate filter units so each operator carries its required value field."],"exampleFix":"// before: { operator: 'containsAny', path: ['tags'] }\n// after:  { operator: 'containsAny', path: ['tags'], valueTextArray: ['red','blue'] }","handlingStrategy":"validation","validationCode":"if (f.operator.toLowerCase() === 'containsany' && (!Array.isArray(f.valueTextArray) || f.valueTextArray.length === 0)) { throw new Error(\"'containsAny' requires a non-empty valueTextArray\"); }","typeGuard":"function isContainsAnyComplete(f: WeaviateFilterUnit): f is WeaviateFilterUnit & { valueTextArray: string[] } { return f.operator.toLowerCase() === 'containsany' && Array.isArray(f.valueTextArray) && f.valueTextArray.every(v => typeof v === 'string'); }","tryCatchPattern":"try { buildFilter(unit) } catch (e) { if (/valueTextArray.*containsAny/.test(e.message)) { /* supply array */ } else throw e; }","preventionTips":["Source containsAny arrays from typed list fields, not raw strings.","Reject empty arrays at the form layer before they reach buildFilter.","Use a shared filter-builder that enforces per-operator value presence."],"tags":["weaviate","filter","validation","operator","array"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}