{"record":{"id":"6fa75f38b85fff93","repo":"chroma-core/chroma","slug":"expected-dict-for-where-got-type-data-name","errorCode":null,"errorMessage":"Expected dict for Where, got {type(data).__name__}","messagePattern":"Expected dict for Where, got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"chromadb/execution/expression/operator.py","lineNumber":92,"sourceCode":"        Supports MongoDB-style query operators:\n        - {\"field\": \"value\"} -> Key(\"field\") == \"value\" (shorthand for equality)\n        - {\"field\": {\"$eq\": value}} -> Key(\"field\") == value\n        - {\"field\": {\"$ne\": value}} -> Key(\"field\") != value\n        - {\"field\": {\"$gt\": value}} -> Key(\"field\") > value\n        - {\"field\": {\"$gte\": value}} -> Key(\"field\") >= value\n        - {\"field\": {\"$lt\": value}} -> Key(\"field\") < value\n        - {\"field\": {\"$lte\": value}} -> Key(\"field\") <= value\n        - {\"field\": {\"$in\": [values]}} -> Key(\"field\").is_in([values])\n        - {\"field\": {\"$nin\": [values]}} -> Key(\"field\").not_in([values])\n        - {\"field\": {\"$contains\": \"text\"}} -> Key(\"field\").contains(\"text\")\n        - {\"field\": {\"$not_contains\": \"text\"}} -> Key(\"field\").not_contains(\"text\")\n        - {\"field\": {\"$regex\": \"pattern\"}} -> Key(\"field\").regex(\"pattern\")\n        - {\"field\": {\"$not_regex\": \"pattern\"}} -> Key(\"field\").not_regex(\"pattern\")\n        - {\"$and\": [conditions]} -> condition1 & condition2 & ...\n        - {\"$or\": [conditions]} -> condition1 | condition2 | ...\n        \"\"\"\n        if not isinstance(data, dict):\n            raise TypeError(f\"Expected dict for Where, got {type(data).__name__}\")\n\n        if not data:\n            raise ValueError(\"Where dict cannot be empty\")\n\n        # Handle logical operators\n        if \"$and\" in data:\n            if not isinstance(data[\"$and\"], list):\n                raise TypeError(\n                    f\"$and must be a list, got {type(data['$and']).__name__}\"\n                )\n            if len(data[\"$and\"]) == 0:\n                raise ValueError(\"$and requires at least one condition\")\n            if len(data) > 1:\n                raise ValueError(\n                    \"$and cannot be combined with other fields in the same dict\"\n                )\n\n            conditions = [Where.from_dict(c) for c in data[\"$and\"]]","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/execution/expression/operator.py#L74-L110","documentation":"Error \"Expected dict for Where, got {type(data).__name__}\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at chromadb/execution/expression/operator.py:92 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"}