Module: kamailio
Branch: master
Commit: 0bf901966aac3026cd0ba4798f5689c66d7f7b4f
URL: 
https://github.com/kamailio/kamailio/commit/0bf901966aac3026cd0ba4798f5689c66d7f7b4f

Author: Kamailio Dev <kamailio....@kamailio.org>
Committer: Kamailio Dev <kamailio....@kamailio.org>
Date: 2017-06-02T15:31:37+02:00

modules: readme files regenerated - ndb_redis ... [skip ci]

---

Modified: src/modules/ndb_redis/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/0bf901966aac3026cd0ba4798f5689c66d7f7b4f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/0bf901966aac3026cd0ba4798f5689c66d7f7b4f.patch

---

diff --git a/src/modules/ndb_redis/README b/src/modules/ndb_redis/README
index 8ef7d7dd9c..c51fe48c3b 100644
--- a/src/modules/ndb_redis/README
+++ b/src/modules/ndb_redis/README
@@ -314,6 +314,12 @@ modparam("ndb_redis", "flush_on_reconnect", 1)
      * value[n] - returns value of the nth element. value - returns null
        for an array. You need to get each element by index.
 
+   In case one of the members of the array is also an array (for example
+   calling SMEMBERS in a MULTI/EXEC transaction), the members of the array
+   can be accessed by adding any of the above keys, after a value[n] key.
+   The first value[n] references the element in the first array, while the
+   next key references an element of the referenced array.
+
    Example 1.9. redis_cmd usage
 ...
 if(redis_cmd("srvN", "INCR cnt", "r")) {
@@ -344,6 +350,16 @@ if(redis_cmd("srvN", "HMGET foo_key field1 field3", "r")) {
     xlog("array size: $redis(r=>size)\n");
     xlog("first values: $redis(r=>value[0]) , $redis(r=>value[1])\n");
 }
+
+
+# array as element of an array example
+redis_cmd("srvN", "MULTI", "r1");
+redis_cmd("srvN", "SMEMBERS foo", "r2");
+if (redis_cmd("srvN", "EXEC", "r")) {
+    xlog("array size: $redis(r=>value[0]=>size)\n");
+    xlog("first member of the set:$redis(r=>value[0]=>value[0])\n");
+    xlog("type of the second member of the 
set:$redis(r=>value[0]=>type[1])\n");
+}
 ...
 
 4.2.  redis_pipe_cmd(srvname, command, ..., replyid)


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to