JSON truncated when added to DB column

For some reason, the JSON in the file below gets truncated when I paste it into my backend JSON database column. The system only saves/keeps the last “topic” record. I need the entire data set to be saved. Please help. Thanks.

Hello @Marc_Chriqui,

According to the json specification it works like a map. If map has several similar keys, only one will remain, the other will be overwritten. Your JSON document has the similar situation, it has a lot of topic keys and only one remains after overwriting:

{
    "topics": {"topic": {...}, "topic": {...}, "topic": {....}}
}

but it will be fine if

{
    "topics": {"topic1": {...}, "topic2": {...}, "topic3": {....}}
}

or if it will be an array of objects not a map.

Regards,
Olha

I see. I will make the change. Thank you!

1 Like