How to search inside Google JSON data'

JSON

{
  "address_components":[
    {
      "long_name":"Huelva",
      "short_name":"Huelva",
      "types":[
        "locality",
        "political"
      ]
    },
    {
      "long_name":"Huelva",
      "short_name":"Huelva",
      "types":[
        "administrative_area_level_2",
        "political"
      ]
    },
    {
      "long_name":"Andalucía",
      "short_name":"AL",
      "types":[
        "administrative_area_level_1",
        "political"
      ]
    },
    {
      "long_name":"España",
      "short_name":"ES",
      "types":[
        "country",
        "political"
      ]
    }
  ],
  "formatted_address":"Huelva, España",
  "geometry":{
    "bounds":{
      "south":37.2504151,
      "west":-6.962591800000041,
      "north":37.2913207,
      "east":-6.916788900000029
    },
    "location":{
      "lat":37.261421,
      "lng":-6.944722400000046},
      "location_type":"APPROXIMATE",
      "viewport":{
        "south":37.2504151,
        "west":-6.962591800000041,
        "north":37.2913207,
        "east":-6.916788900000029
      }
    },
    "place_id":"ChIJSyhE1-bPEQ0Rgw-0EMGqK9g",
    "types":[
      "locality",
      "political"
    ]
  }

How can I search for matches inside Country, administrative_area_level_1, administrative_area_level_2, administrative_area_level_3 and administrative_area_level_4. I mean the portion that is above: formatted_address

I would like to use LIKE

Apache MYSQL

I would like ti use some like this:

json LIKE 'usa,%' OR json LIKE '% usa,%' OR json LIKE '% usa' OR json = 'usa' OR json LIKE '% usa %' OR json LIKE '% usa' OR json LIKE 'usa %'

This seems to be working. Not sure if this is the right approach:

json = '"fl"' OR json LIKE '% fl"' OR json LIKE '% fl %' OR json LIKE '% fl"' OR json LIKE '"fl %'

MySQL 5.7 introduced JSON support with several new functions. If you are using 5.7+ I would recommend looking into those options.

https://dev.mysql.com/doc/refman/5.7/en/json.html

Thanks buddy gonna give it a read.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.