I have a JSON blob that I am trying to extract a value from, specifically, the Zip Code under the Rating Information section (Expected value = 90703). Does MySql 8 support JSON filter expressions?
JSON:
{ "quote_number": null, "items": [ { "annual_amount": 0.0, "pro_rata_amount": 0.0, "name": "Value Information", "categories": { "Use": "Single Family Detached", "Zip Code": "51431", "Floor Coverings": "Carpet" } }, { "annual_amount": 0.0, "pro_rata_amount": 0.0, "name": "Rating Information", "categories": { "Number of Non-Weather Water Losses": "0", "Protection Class": "2", "Zip Code": "90703", "Special Hazard Interface Area": "N" } } ], "total": { "annual_fees": 0.0, "annual_premium": 9.0 }, "policy_id": null }
Path: $.items[?(@.name=="Rating Information")].categories.Zip Code
The path appears to be correct as I get data when testing via this site: https://jsonpath.com/
If MySql doesn't support JSON filtering, what is the recommended work around?
Joe