{"record":{"id":"e86411d2f3c072ab","repo":"chroma-core/chroma","slug":"where-dict-must-contain-exactly-one-field-got-le","errorCode":null,"errorMessage":"Where dict must contain exactly one field, got {len(data)}","messagePattern":"Where dict must contain exactly one field, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/execution/expression/operator.py","lineNumber":139,"sourceCode":"            if len(data[\"$or\"]) == 0:\n                raise ValueError(\"$or requires at least one condition\")\n            if len(data) > 1:\n                raise ValueError(\n                    \"$or cannot be combined with other fields in the same dict\"\n                )\n\n            conditions = [Where.from_dict(c) for c in data[\"$or\"]]\n            if len(conditions) == 1:\n                return conditions[0]\n            result = conditions[0]\n            for c in conditions[1:]:\n                result = result | c\n            return result\n\n        else:\n            # Single field condition\n            if len(data) != 1:\n                raise ValueError(\n                    f\"Where dict must contain exactly one field, got {len(data)}\"\n                )\n\n            field, condition = next(iter(data.items()))\n\n            if not isinstance(field, str):\n                raise TypeError(\n                    f\"Field name must be a string, got {type(field).__name__}\"\n                )\n\n            if isinstance(condition, dict):\n                # Operator-based condition\n                if not condition:\n                    raise ValueError(\n                        f\"Operator dict for field '{field}' cannot be empty\"\n                    )\n                if len(condition) != 1:\n                    raise ValueError(","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/execution/expression/operator.py#L121-L157","documentation":"Error \"Where dict must contain exactly one field, got {len(data)}\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/execution/expression/operator.py:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}