We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3ef2de commit ca1bf24Copy full SHA for ca1bf24
examples/zsets.py
@@ -0,0 +1,17 @@
1
+from cssdbpy import Connection
2
+import md5
3
+
4
+if __name__ == '__main__':
5
+ conn = Connection('127.0.0.1', 8888)
6
+ for i in xrange(0, 10000):
7
+ md5word = md5.new('word{}'.format(i)).hexdigest()
8
+ create = conn.execute('zset','ztest', md5word, i)
9
+ value = conn.execute('zget','ztest', md5word)
10
+ conn.execute('zincr','ztest', md5word)
11
+ conn.execute('zincr','ztest', md5word, 10)
12
+ exists = conn.execute('zexists','ztest', md5word)
13
+ delete = conn.execute('zdel','ztest', md5word)
14
+ print md5word, value, create, exists, delete
15
+ print conn.execute('zscan', 'ztest', '', 0, 1000, 10)
16
+ print conn.execute('zrscan', 'ztest', 1000, 0, 10)
17
+ conn.execute('zclean','words')
0 commit comments