Rits
Rits

Reputation: 9

Storing JSON as key value pair

My question is how to store a nested JSON as key value in mysql table. Earlier I thought of storing it as CSV but on deep diving I found it like it would be difficult to query those values and to manage as well. Please help me in giving alternate solutions of how and where to store JSON.

The version of MySQL I am using does not support the JSON data type

Upvotes: 0

Views: 2687

Answers (2)

Paul Wasilewski
Paul Wasilewski

Reputation: 10372

Since MySQL 5.7 a native JSON data type is supported.

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

If your MySQL version is lower the only option left is to store it as text. Otherwise you will not be able to store it in a simple key value pair manner.

Upvotes: 1

joel314
joel314

Reputation: 1080

If you are using MySQL 5.7, you can store ans query JSON objects. Look at this link for more details and examples.

Upvotes: 1

Related Questions