{"record":{"id":"69f7b23f6f1fcec8","repo":"mem0ai/mem0","slug":"unsupported-neptune-analytics-filter-operator-o","errorCode":null,"errorMessage":"Unsupported Neptune Analytics filter operator: ${operator}","messagePattern":"Unsupported Neptune Analytics filter operator: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/neptune_analytics.ts","lineNumber":659,"sourceCode":"        return {\n          stringContains: {\n            property: key,\n            value: operand,\n          },\n        };\n      case \"startsWith\":\n        return {\n          startsWith: {\n            property: key,\n            value: operand,\n          },\n        };\n      case \"icontains\":\n        throw new Error(\n          \"Neptune Analytics vector search does not support case-insensitive contains filters.\",\n        );\n      default:\n        throw new Error(\n          `Unsupported Neptune Analytics filter operator: ${operator}`,\n        );\n    }\n  }\n\n  private negateVertexFilter(filter: NeptuneVertexFilter): NeptuneVertexFilter {\n    if (Array.isArray(filter.andAll)) {\n      return this.combineVertexFilters(\n        \"orAll\",\n        filter.andAll.map((entry: NeptuneVertexFilter) =>\n          this.negateVertexFilter(entry),\n        ),\n      )!;\n    }\n\n    if (Array.isArray(filter.orAll)) {\n      return this.combineVertexFilters(\n        \"andAll\",","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/neptune_analytics.ts#L641-L677","documentation":"Operator objects dispatched in buildOperatorFilter (the switch that maps operator names to Neptune filter shapes) fall through to a default case that throws, listing the unsupported operator. Only a whitelist (eq/in/notIn/contains/startsWith and similar) is implemented; anything else (gte, lte, ne, regex, icontains...) has no Neptune translation.","triggerScenarios":"Passing { ts: { gte: 1700000000 } }, { name: { regex: 'a.*' } }, { n: { between: [1,2] } } or any operator string outside the supported set; typos in operator names ('startswith' vs 'startsWith'); generic operator vocabularies from other providers reused against Neptune.","commonSituations":"Porting range/comparison filters from SQL-backed stores; LLM-generated filter operators; version drift if operator names change between Python and TS providers.","solutions":["Rewrite the filter using supported operators (equality, in, contains, startsWith) or plain field equality.","Over-fetch with supported filters, then apply gte/lte/regex client-side on payloads.","For rich querying, move the data to a provider that supports the operators (postgres/qdrant) or query Neptune with openCypher directly."],"exampleFix":"// before\nstore.search(q, 50, { ts: { gte: 1700000000 } }); // throws: Unsupported operator\n\n// after\nconst res = await store.search(q, 50, { user_id: 'u1' });\nconst filtered = res.filter(r => (r.payload?.ts ?? 0) >= 1700000000);","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['eq', 'in', 'notIn', 'contains', 'startsWith']);\nfunction findUnsupportedOps(node: any, path = ''): string[] {\n  const bad: string[] = [];\n  for (const [k, v] of Object.entries(node ?? {})) {\n    if (v && typeof v === 'object' && !Array.isArray(v)) {\n      for (const op of Object.keys(v)) if (!SUPPORTED.has(op)) bad.push(`${path}${k}.${op}`);\n    }\n  }\n  return bad;\n}","typeGuard":"const isSupportedNeptuneOp = (op: string): boolean =>\n  ['eq', 'in', 'notIn', 'contains', 'startsWith'].includes(op);","tryCatchPattern":"try { results = await store.search(q, k, filters); }\ncatch (e) {\n  if (e instanceof Error && e.message.startsWith('Unsupported Neptune Analytics filter operator')) {\n    // downgrade unsupported ops (gte/lte/regex) to client-side post-filtering\n  } else throw e;\n}","preventionTips":["Validate operator names against the supported set before calling search.","Do range/regex filtering client-side on returned payloads, or pick another provider.","Watch for casing: startsWith (camelCase), not startswith."],"tags":["neptune","filters","unsupported-operation","validation","vector-store"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}