title: How to add values to a JSON column on mysql?
body: <p>I have a MEDIUMTEXT column on my 'display_profile' table which look like this - </p>
  
  <pre><code>{
  "artistId": null,
  "memberId": "e7dbb746-a243-4247-9c27-fd184a81bd1a",
  "displayName": "yoav alias",
  "location": {
  "value": "Rock Shilde, NY",
  "publishable": true
  },
  "socialLinks": [
  {
    "value": {
      "socialNetwork": "facebook",
      "link": "https://www.facebook.com/"
    },
    "publishable": true
  },
  {
    "value": {
      "socialNetwork": "twitter",
      "link": null
    },
    "publishable": true
  },
  {
    "value": {
      "socialNetwork": "google",
      "link": null
    },
    "publishable": true
  },
  {
    "value": {
      "socialNetwork": "soundcloud",
      "link": null
    },
    "publishable": true
  }
  ],
  "instruments": {
  "value": [
  
  ],
  "publishable": true
  },
  "favorites": {
  "value": [
  
  ],
  "publishable": true
  },
  "bio": {
  "value": null,
  "publishable": true
  }
  </code></pre>
  
  <p>All I wanna do is insert values to "favorites" ... I searched the web </p>
  
  <p>quit a lot and no luck yet. I'm basically looking for the correct mySQL </p>
  
  <p>syntax to do so. Although the column is designed as a JSON it is define </p>
  
  <p>as a MEDIUMTEXT. Well nevertheless I would like to add values to this column for some reason this is a tricky task .. I have tried -</p>
  
  <pre><code>UPDATE display_profiles JSON_INSERT(display_profile, '$.favorites', 
  'red') WHERE member_id = ?   
  </code></pre>
  
  <p>But I get a sql syntax exception... any ideas ?</p>