Storing a JSON object in CASSANDRA

I want to store JSON in CASSANDRA db. Each JSON field must be mapped to a corresponding column.

Is it possible? if possible, how can I achieve it?

Please help me guys ..

+1
source share
1 answer

The answer is the same as in another message. Cassandra is no more schematic, so there is no ready-made solution (unless you have a predefined json structure). What you can do is create a first level json structure in Map <text, text> (If, as I think, you need to select the entry by key)

{
  "keya": {
      "keyb": 5,
      "keyc": "somestring"
   },
  "keyd": 3;
}

This will be displayed in the following map entries.

<keya, '{ "keyb": 5, "keyc": "somestring" }'>
<keyd, '3'>

json, . "" :

<keya, '{ "keyb": 5, "keyc": "somestring" }'>
<keya.keyb, '5'>
<keya.keyc": ' "somestring" '>
<keyd, '3'>

, Json. , , , json, . : , , uuid, float - Strings.

, Carlo

+2

All Articles