0

I have a MySQL table field with JSON content inside. I tried searching the net around but couldn't find a way how to store JSON from MySQL to GridDB as key value pair.

My sample data are such:

{
"productName": "HP Desktop",
"price": 2000,
"specification": [],
}

I expect it to store in GridDB as a collection with productName as the RowKey.

Shadow
  • 33,525
  • 10
  • 51
  • 64
Chuah Cheng Jun
  • 243
  • 1
  • 3
  • 17
  • 1
    Just to nail down what your question is really about: 1) Do you have a problem extracting the json data from mysql in a specific format and thus you have a mysql question how to transform data to a specific structure? 2) Or the way you extract data from mysql is fine, but you have a griddb question on transforming that dataset in griddb? Deciding between the two questions help us to determine if your question is about one or the other database product. – Shadow Jun 07 '23 at 18:23
  • Maybe what you want! `JSON_DECODE()` will convert a json string representing an array of key-value pairs into an array of key-value pairs – RiggsFolly Jun 07 '23 at 19:54
  • @Shadow i have no issue on extracting the JSON from mysql, my problem is i don't know how to assign the key value pair into GridDB as a collection – Chuah Cheng Jun Jun 10 '23 at 13:17

0 Answers0