Extract value without quotation mark from MySQL JSON data type
<p>I have started using the JSON data type in mysql 5.7. Is there a way to extract a value without the quotation marks? For instance when setting up a virtual index.</p>

<p>Example: </p>

<pre><code>mysql&gt; INSERT INTO test (data) VALUES ('{"type": "user" , 
"content" : { "username": "jdoe", "firstname" : "John", "lastname" : "Doe" } }');

mysql&gt; SELECT json_extract(data,'$.type') FROM test;
+-----------------------------+
| json_extract(data,'$.type') |
+-----------------------------+
| "user"                      |
+-----------------------------+
</code></pre>

<p>How to get</p>

<pre><code>+-----------------------------+
| json_extract(data,'$.type') |
+-----------------------------+
| user                        |
+-----------------------------+
</code></pre>

<p>?</p>