Sunday 19 April 2015

Redis

      Redis cache
      Install and configure redis in ubuntu
      Uninstall Redis from Ubuntu
      Redis data types
            String
            List
            Hashes
            Sets
            Sorted Sets
            Bitmap
            HyperLogLog
      String handling commands
            Appends to string
             BITCOUNT : Count the number of bits set in given string
            BITOP : Perform bit operation on strings
            DECR : Decrement the value of key by one
            DECRBY key decrement : Decrement the value stored at key by decrement
            GET key : Get the value of the key
             GETBIT key offset : Get bit value of string at specific offset
            GETRANGE key start end : Gets the substring
            GETSET key value
            INCR key : Increment value stored at key by one
            INCRBY key increment
            INCRBYFLOAT key increment
            MGET key1 key2 ... keyn
            MSET key1 value1 key2 value2 ... keyN valueN
            MSETNX key value
            SET key value
            PSETEX key milliseconds value
            SETBIT key offset value
            SETEX key seconds value
            SETNX key value
            STRLEN key
      List commands
            LPUSH key value1 value2 ... valueN
            LPUSHX key value
            RPUSH key value
            RPUSHX key value
            LPOP key
            RPOP key
            LRANGE key start stop
            LREM key count value
            LSET key index value
            LINDEX key index
            LLEN key
            LTRIM key start stop
            LINSERT key BEFORE|AFTER pivot value
            BLPOP key1 key2 ... keyN timeout
            BRPOP key1, key2 ...keyN timeout
            RPOPLPUSH source destination
            BRPOPLPUSH source destination timeout
      Set operations
            SADD key value1 value2 ... valueN
            SCARD key : Get the number of elements in a set
            SMEMBERS key : Get all members of a set
            SISMEMBER key member : Check member existence
            SRANDMEMBER key count : Get random element from set
            SPOP key count
            SDIFF key1 key2 ...keyN
            SDIFFSTORE destination key1 key2 ...keyN
            SINTER key1 key2 ... keyN
            SINTERSTORE destination key1 key2 ... keyN
            SMOVE source destination member
            SREM key member1 member2 ... memberN
            SUNION key1 key2 ...keyN
            SUNIONSTORE destination key1 key2 ...keyN
      Sorted Set operations
            ZADD key score1 member1 score2 member2 .... scoreN memberN
            ZCARD key : Get the cardinality of the set
            ZCOUNT key min max
            ZINCRBY key increment member
            ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]
            ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]
            ZRANGE key start stop [WITHSCORES]
            ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
            ZREVRANGE key start stop [WITHSCORES]
            ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]
            ZRANK key member
            ZREVRANK key member
            ZREM key member1 member2 ... memberN
      hashes operations
            HSET key field value
            HMSET key field1 value1 field2 value2 ... fieldN valueN
            HGET key field
            HMGET key field1 field2 ... fieldN
            HEXISTS key field
            HGETALL key
            HDEL key field1 field2 ... fieldN
            HLEN key
            HVALS key
            HINCRBY key field increment
            HINCRBYFLOAT key field increment
            HSETNX key field value
            HSTRLEN key field
      Hyperloglog commands
      PFADD key element1 element2 ... elementN
      PFCOUNT key1 key2 ... keyN
      PFMERGE destkey sourcekey1 sourcekey2 ... sourcekeyN

Other Topics

      How to know redis version
      Clear every thing in redis
      Get all keys from redis
      Bind redis server to listen to IP address of the machine
      Install Redis on MAC OS

No comments:

Post a Comment