Wednesday 15 September 2010

database design - Redis storing and querying complex structures -


I want to store an essential structure in a radiant sorted set as JSON object. {"A": "100"}, {"b": "50"}, {"c": "180"}, {"d">

  ZADD "mysetkey" "" "200"}] ZADD "mysetkey" 101 [["A": "10"}, {"b": "50"}, {"c": "70"}, {"d": "200" } "" ZADD "mysetkey" 88 [["A": "300"}, {"b": "50"}, {"c": "110"}, {"d": "200"}]   

Is it easy to operate or search on organized values? For example, if I want to get Samoff (A) for all the elements ? Or all elements Get those who have A 20 and C> of 100 .

My understanding is that this is not possible because Redis has everything But still wanted to confirm it.

In addition, it is possible to get it in Redis using a combination of data structures supported by Redis.

You can apply the required functionality to the Lua script. When Lea Script Redis loads among other people load cjson Evaluate the library and from this library you can get your JSON its value Issues allow removal. A code sample from Evil View command

:

  json_text = '[true, {"foo": "bar"}]' value = Cjson.decode (json_text) - Return the note that Redis evaluates the script at a time, and any other client can run their commands while running a script, so it's probably right for you now.   

No comments:

Post a Comment