[[+content_image]]
B
B
beduin012015-11-29 16:14:37
JavaScript
beduin01, 2015-11-29 16:14:37

What is the best way to store this JSON in the database?

I have an online test whose questions are serialized in JSON. The output is something like:

[[{"QID":1,"AID":1},{"SubAID":[]}],[{"QID":2,"AID":1},{"SubAID":[]}],[{"QID":3,"
AID":1},{"SubAID":[]}],{"MaxArea":"90","MinArea":"10"}]

I need to store it in a database. The question is - is this kind of normal or do I need to do something else with it? If yes, then what.
If I want to store everything in a recreational database, then should I save it as a string?
Then sampling of statistics then how to do?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexander Melnichenko, 2015-11-29
@alex87melnichenko

You can store it in this form, but if you do not conduct a search or some kind of manipulation on them.

A
angry_stitch, 2015-11-29
@angry_stitch

Json type is in postgresql with indexing.
www.postgresql.org/docs/9.4/static/datatype-json.html
or you can use Mongo document-oriented database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question