{"record":{"id":"29eb46a36c4ab0cb","repo":"mem0ai/mem0","slug":"not-filter-value-must-be-a-list-of-filter-dicts-g","errorCode":null,"errorMessage":"NOT filter value must be a list of filter dicts, got ${typeof value}","messagePattern":"NOT filter value must be a list of filter dicts, got (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/cassandra.ts","lineNumber":568,"sourceCode":"        ) {\n          return false;\n        }\n      } else if (key === \"OR\") {\n        if (!Array.isArray(value)) {\n          throw new Error(\n            `OR filter value must be a list of filter dicts, got ${typeof value}`,\n          );\n        }\n        if (\n          !value.some((entry: SearchFilters) =>\n            this.filterVector(vector, entry),\n          )\n        ) {\n          return false;\n        }\n      } else if (key === \"NOT\") {\n        if (!Array.isArray(value)) {\n          throw new Error(\n            `NOT filter value must be a list of filter dicts, got ${typeof value}`,\n          );\n        }\n        if (\n          !value.every(\n            (entry: SearchFilters) => !this.filterVector(vector, entry),\n          )\n        ) {\n          return false;\n        }\n      } else if (!this.matchFieldCondition(vector.payload, key, value)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/cassandra.ts#L550-L586","documentation":"filterVector() requires a 'NOT' key to be an array of filter objects; every entry must fail to match for the vector to pass. A non-array value throws before evaluation, mirroring the AND/OR guards so all three combinators fail consistently.","triggerScenarios":"Passing filters like { NOT: { user_id: 'x' } } (single dict) or { NOT: 'x' } to search/list/getAll on the Cassandra store.","commonSituations":"Expecting NOT to take a single exclusion object (as in some other APIs); converting from Qdrant's must_not style where the payload is one condition object.","solutions":["Wrap the NOT value in an array of filter dicts: { NOT: [{ user_id: 'x' }] }","For excluding multiple conditions, list each as its own entry: { NOT: [{ status: 'draft' }, { deleted: true }] }"],"exampleFix":"// before\nmemory.search('q', { filters: { NOT: { user_id: 'x' } } });\n\n// after\nmemory.search('q', { filters: { NOT: [{ user_id: 'x' }] } });","handlingStrategy":"type-guard","validationCode":"if (filters.NOT && !Array.isArray(filters.NOT)) throw new Error('NOT must be an array of filter dicts');","typeGuard":"const isFilterDictArray = (v: unknown): v is Record<string, any>[] =>\n  Array.isArray(v) && v.every((e) => e !== null && typeof e === 'object' && !Array.isArray(e));","tryCatchPattern":null,"preventionTips":["Wrap exclusions as { NOT: [{...}] } in shared filter builders","Never pass a bare condition object under AND/OR/NOT"],"tags":["cassandra","filters","validation","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}