|
@@ -1132,13 +1132,17 @@ if(sht_match_str_value("ha", "eq", "alice")) {
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : Name of the hash table to dump
|
|
* htable : Name of the hash table to dump
|
|
- * key : Key name of the hash table value to dump
|
|
|
|
|
|
+ * key : Key name of the hash table value to dump. Note: if key name
|
|
|
|
+ is an integer value, it should be prefixed with s:
|
|
|
|
|
|
Example:
|
|
Example:
|
|
...
|
|
...
|
|
# Dump $sht(students=>alice)
|
|
# Dump $sht(students=>alice)
|
|
kamcmd htable.get students alice
|
|
kamcmd htable.get students alice
|
|
|
|
|
|
|
|
+# Dump $sht(students=>15)
|
|
|
|
+kamcmd htable.get students s:15
|
|
|
|
+
|
|
# Dump first entry in array key course $sht(students=>course[0])
|
|
# Dump first entry in array key course $sht(students=>course[0])
|
|
kamcmd htable.get students course[0]
|
|
kamcmd htable.get students course[0]
|
|
...
|
|
...
|
|
@@ -1151,13 +1155,17 @@ kamcmd htable.get students course[0]
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : Name of the hash table to delete
|
|
* htable : Name of the hash table to delete
|
|
- * key : Key name of the hash table value to delete
|
|
|
|
|
|
+ * key : Key name of the hash table value to delete. Note: if key name
|
|
|
|
+ is an integer value, it should be prefixed with s:
|
|
|
|
|
|
Example:
|
|
Example:
|
|
...
|
|
...
|
|
# Delete $sht(students=>alice)
|
|
# Delete $sht(students=>alice)
|
|
kamcmd htable.delete students alice
|
|
kamcmd htable.delete students alice
|
|
|
|
|
|
|
|
+# Delete $sht(students=>15)
|
|
|
|
+kamcmd htable.delete students s:15
|
|
|
|
+
|
|
# Delete first entry in array key course $sht(students=>course[0])
|
|
# Delete first entry in array key course $sht(students=>course[0])
|
|
kamcmd htable.delete students course[0]
|
|
kamcmd htable.delete students course[0]
|
|
...
|
|
...
|
|
@@ -1170,7 +1178,8 @@ kamcmd htable.delete students course[0]
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : Name of the hash table
|
|
* htable : Name of the hash table
|
|
- * key : Key name in the hash table
|
|
|
|
|
|
+ * key : Key name in the hash table. Note: if key name is an integer
|
|
|
|
+ value, it should be prefixed with s:
|
|
* Value : String value for the item
|
|
* Value : String value for the item
|
|
|
|
|
|
Example:
|
|
Example:
|
|
@@ -1178,6 +1187,9 @@ kamcmd htable.delete students course[0]
|
|
# Set $sht(test=>x) as string
|
|
# Set $sht(test=>x) as string
|
|
kamcmd htable.sets test x abc
|
|
kamcmd htable.sets test x abc
|
|
|
|
|
|
|
|
+# Set $sht(test=>5) as string
|
|
|
|
+kamcmd htable.sets test s:5 abc
|
|
|
|
+
|
|
# Set firsti entry in array key x $sht(test=>x[0]) as string
|
|
# Set firsti entry in array key x $sht(test=>x[0]) as string
|
|
kamcmd htable.sets test x[0] abc
|
|
kamcmd htable.sets test x[0] abc
|
|
...
|
|
...
|
|
@@ -1190,7 +1202,8 @@ kamcmd htable.sets test x[0] abc
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : Name of the hash table
|
|
* htable : Name of the hash table
|
|
- * key : Key name in the hash table
|
|
|
|
|
|
+ * key : Key name in the hash table. Note: if key name is an integer
|
|
|
|
+ value, it should be prefixed with s:
|
|
* Value : Integer value for the item
|
|
* Value : Integer value for the item
|
|
|
|
|
|
Example:
|
|
Example:
|
|
@@ -1198,6 +1211,9 @@ kamcmd htable.sets test x[0] abc
|
|
# Set $sht(test=>x) as integer
|
|
# Set $sht(test=>x) as integer
|
|
kamcmd htable.seti test x 123
|
|
kamcmd htable.seti test x 123
|
|
|
|
|
|
|
|
+# Set $sht(test=>5) as integer
|
|
|
|
+kamcmd htable.seti test s:5 123
|
|
|
|
+
|
|
# Set first entry in array key x $sht(test=>x[0]) as integer
|
|
# Set first entry in array key x $sht(test=>x[0]) as integer
|
|
kamcmd htable.seti test x[0] 123
|
|
kamcmd htable.seti test x[0] 123
|
|
...
|
|
...
|
|
@@ -1210,13 +1226,17 @@ kamcmd htable.seti test x[0] 123
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : name of the hash table
|
|
* htable : name of the hash table
|
|
- * key : key name in the hash table
|
|
|
|
|
|
+ * key : key name in the hash table. Note: if key name is an integer
|
|
|
|
+ value, it should be prefixed with s:
|
|
* expire : integer value for the expire (seconds)
|
|
* expire : integer value for the expire (seconds)
|
|
|
|
|
|
Example:
|
|
Example:
|
|
...
|
|
...
|
|
# set expire for $sht(test=>x) to 120 secs
|
|
# set expire for $sht(test=>x) to 120 secs
|
|
-kamctl rpc htable.seti test x 120
|
|
|
|
|
|
+kamctl rpc htable.setex test x 120
|
|
|
|
+
|
|
|
|
+# set expire for $sht(test=>10) to 120 secs
|
|
|
|
+kamctl rpc htable.setex test s:10 120
|
|
...
|
|
...
|
|
|
|
|
|
6.6. htable.setxs htable key value expire
|
|
6.6. htable.setxs htable key value expire
|
|
@@ -1227,7 +1247,8 @@ kamctl rpc htable.seti test x 120
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : name of the hash table
|
|
* htable : name of the hash table
|
|
- * key : key name in the hash table
|
|
|
|
|
|
+ * key : key name in the hash table. Note: if key name is an integer
|
|
|
|
+ value, it should be prefixed with s:
|
|
* value : string value for the item
|
|
* value : string value for the item
|
|
* expire : integer value for the expire (seconds)
|
|
* expire : integer value for the expire (seconds)
|
|
|
|
|
|
@@ -1235,6 +1256,9 @@ kamctl rpc htable.seti test x 120
|
|
...
|
|
...
|
|
# set value to 'abc' and expire for $sht(test=>x) to 120 secs
|
|
# set value to 'abc' and expire for $sht(test=>x) to 120 secs
|
|
kamctl rpc htable.setxs test x abc 120
|
|
kamctl rpc htable.setxs test x abc 120
|
|
|
|
+
|
|
|
|
+# set value to 'abc' and expire for $sht(test=>10) to 120 secs
|
|
|
|
+kamctl rpc htable.setxs test s:10 abc 120
|
|
...
|
|
...
|
|
|
|
|
|
6.7. htable.setxi htable key value expire
|
|
6.7. htable.setxi htable key value expire
|
|
@@ -1245,7 +1269,8 @@ kamctl rpc htable.setxs test x abc 120
|
|
|
|
|
|
Parameters:
|
|
Parameters:
|
|
* htable : name of the hash table
|
|
* htable : name of the hash table
|
|
- * key : key name in the hash table
|
|
|
|
|
|
+ * key : key name in the hash table. Note: if key name is an integer
|
|
|
|
+ value, it should be prefixed with s:
|
|
* value : integer value for the item
|
|
* value : integer value for the item
|
|
* expire : integer value for the expire (seconds)
|
|
* expire : integer value for the expire (seconds)
|
|
|
|
|
|
@@ -1253,6 +1278,9 @@ kamctl rpc htable.setxs test x abc 120
|
|
...
|
|
...
|
|
# set value to 10 and expire for $sht(test=>x) to 120 secs
|
|
# set value to 10 and expire for $sht(test=>x) to 120 secs
|
|
kamctl rpc htable.setxi test x 10 120
|
|
kamctl rpc htable.setxi test x 10 120
|
|
|
|
+
|
|
|
|
+# set value to 10 and expire for $sht(test=>5) to 120 secs
|
|
|
|
+kamctl rpc htable.setxi test s:5 10 120
|
|
...
|
|
...
|
|
|
|
|
|
6.8. htable.dump htable
|
|
6.8. htable.dump htable
|