{"record":{"id":"4359341702bc4347","repo":"Budibase/budibase","slug":"unsupported-operator-operator","errorCode":null,"errorMessage":"Unsupported operator: ${operator}","messagePattern":"Unsupported operator: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shared-core/src/filters.ts","lineNumber":504,"sourceCode":"\n      // Transform boolean filters to cope with null.  \"equals false\" needs to\n      // be \"not equals true\" \"not equals false\" needs to be \"equals true\"\n      if (operator === \"equal\" && value === false) {\n        query.notEqual = query.notEqual || {}\n        query.notEqual[field] = true\n      } else if (operator === \"notEqual\" && value === false) {\n        query.equal = query.equal || {}\n        query.equal[field] = true\n      } else {\n        query[operator] ??= {}\n        query[operator][field] = value\n      }\n    } else {\n      query[operator] ??= {}\n      query[operator][field] = value\n    }\n  } else {\n    throw new Error(`Unsupported operator: ${operator}`)\n  }\n\n  return query\n}\n\nexport interface LegacyFilterSplit {\n  allOr?: boolean\n  onEmptyFilter?: EmptyFilterOption\n  filters: SearchFilter[]\n}\n\nexport function splitFiltersArray(filters: LegacyFilter[]) {\n  const split: LegacyFilterSplit = {\n    filters: [],\n  }\n\n  for (const filter of filters) {\n    if (\"operator\" in filter && filter.operator === \"allOr\") {","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/shared-core/src/filters.ts#L486-L522","documentation":"A plain Error thrown by buildCondition in packages/shared-core/src/filters.ts when the operator passed for a filter is not one the builder supports. The function only reaches this branch when the operator falls outside the recognised operator set used to build query predicates, meaning the caller supplied an unknown/misspelled operator string or an operator valid in a different filter context (e.g. legacy vs structured filters).","triggerScenarios":"Calling a search/query API (or building a filter programmatically) with an operator string like \"like\", \"not_equal\" variants, or a typo such as \"equalss\" that the filter builder does not recognise.","commonSituations":"Migrating from legacy filter syntax to the newer structured filters where operator names changed; hand-written JSON filters in API clients; building operators dynamically from user input or a mapping table that is out of date with shared-core.","solutions":["Check the operator value at the failing call site against the supported operator enum in shared-core filters (use the Operators/enum exports rather than raw strings).","Fix typos and case: operators are matched exactly.","If migrating from legacy filters, convert the legacy operator names to the current equivalents.","Add a whitelist/lookup of allowed operators in the caller before building the condition."],"exampleFix":"// before\nbuildCondition({ operator: \"equalss\", field: \"name\", value: \"x\" })\n// after\nimport { Operators } from \"@budibase/shared-core\"\nbuildCondition({ operator: Operators.EQUAL, field: \"name\", value: \"x\" })","handlingStrategy":"type-guard","validationCode":"import { Operators } from \"@budibase/shared-core\"\nconst ALLOWED = new Set<string>(Object.values(Operators))\nif (!ALLOWED.has(filter.operator)) {\n  throw new Error(`Operator '${filter.operator}' not supported; allowed: ${[...ALLOWED].join(\", \")}`)\n}","typeGuard":"function isSupportedOperator(op: string): op is Operators {\n  return (Object.values(Operators) as string[]).includes(op)\n}","tryCatchPattern":"try {\n  const query = buildSearchQuery(filters)\n} catch (e) {\n  if (e.message.startsWith(\"Unsupported operator\")) {\n    console.warn(`Bad operator in filters: ${e.message}; falling back to EQ`)\n    return buildSearchQuery(filters.map(f => ({ ...f, operator: Operators.EQUAL })))\n  }\n  throw e\n}","preventionTips":["Always reference the Operators enum from shared-core instead of raw strings","Validate user/operator mapping tables against the enum on startup","When migrating legacy filter syntax, map operator names explicitly","Add unit tests enumerating every operator your client can send"],"tags":["filters","validation","query"],"backgroundTag":"unsupported-operator","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}