I have arrays that I want to save in the database, the arrays have about 1000 elements, should I save them in string or in what type?
+--------------------+
tabla caracteristicas
piel [datos]
ojos [datos]
expresiones [datos]
+--------------------+
I must save the complete arrays and not element by element
in the bd I put
piel varchar(1000) not null,
But what if my skin array has 2000 elements? varchar(1000) would no longer suffice, do I need unlimited size?
Note : Also, if I want to save 1000 elements with varchar(1000) it would not supply either, because since it is a string it counts up to the brackets, commas...
when I insert with json ( VALUES (1,'{"data": {"language": "spanish", "age": 39}}',1,1);
) according to @Alfredo's answer I get the following:
It depends, you can use the JSON data format, in the following cases
Important
Thus
TO INSERT
TO QUERY A SPECIFIC JSON VALUE
TO CHECK THE FULL JSON
MORE ABOUT JSON
If you do the DESCRIBE person command; to check more about the table you will realize that internally it handles it as a LONG TEXT
UPDATE
For purposes perhaps only aesthetic
We can use mariaDB's own JSON_DETAILED function (its equivalent in MySQL would be JSON_PRETTY) to get a better view of the structure