{
  "id": "mongodb/geo-haystack-index-not-supported",
  "signature": "MongoServerError: geoHaystack index is not supported in this version",
  "signature_zh": "MongoServerError：此版本不支持geoHaystack索引",
  "regex": "geoHaystack index is not supported",
  "domain": "mongodb",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The geoHaystack index type was deprecated and removed in MongoDB 5.0+, but the application still tries to create or use it.",
  "root_cause_type": "generic",
  "root_cause_zh": "geoHaystack索引类型在MongoDB 5.0+中已被弃用并移除，但应用程序仍尝试创建或使用它。",
  "versions": [
    {
      "version": "mongodb 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb 5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Downgrading is not recommended and may cause data compatibility issues.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "No such flag exists; the feature is completely removed.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Replace geoHaystack with a 2dsphere index: db.collection.createIndex({ location: '2dsphere' }) and use $nearSphere or $geoWithin queries.",
      "success_rate": 0.9,
      "how": "Replace geoHaystack with a 2dsphere index: db.collection.createIndex({ location: '2dsphere' }) and use $nearSphere or $geoWithin queries.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If bounding box queries are needed, use $geoWithin with $box: db.places.find({ location: { $geoWithin: { $box: [ [0,0], [10,10] ] } } })",
      "success_rate": 0.85,
      "how": "If bounding box queries are needed, use $geoWithin with $box: db.places.find({ location: { $geoWithin: { $box: [ [0,0], [10,10] ] } } })",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "用2dsphere索引替换geoHaystack：db.collection.createIndex({ location: '2dsphere' })并使用$nearSphere或$geoWithin查询。",
    "如果需要边界框查询，使用带有$box的$geoWithin：db.places.find({ location: { $geoWithin: { $box: [ [0,0], [10,10] ] } } })"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/release-notes/5.0-compatibility/#index-removal",
  "official_doc_section": null,
  "error_code": "404",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-06-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}