redis-types
redis type objects - hashes, lists, sets, etc
Installation
npm install redis-types
Usage
Uses redis node module under the hood. Syntax is identical except that the redis-key is specified through the constructor.
Key
- SET
- DEL
- DUMP
- EXISTS
- EXPIRE
- EXPIREAT
- MOVE
- PERSIST
- PEXPIRE
- PEXPIREAT
- PTTL
- RENAME
- RENAMENX
- RESTORE
- SORT
- TTL
- TYPE
- Lowercase works too
var RedisKey = Key;var redisKey = 'foo';redisKey;
Strings
- Inherits from Keys
- APPEND
- BITCOUNT
- BITOP
- BITPOS
- DECR
- DECRBY
- GET
- GETBIT
- GETRANGE
- GETSET
- INCR
- INCRBY
- INCRBYFLOAT
- MGET
- MSET
- MSETNX
- PSETEX
- SET
- SETBIT
- SETEX
- SETNX
- SETRANGE
- STRLEN
- Lowercase works too
var RedisString = String;var redisString = 'foo';redisString;
Lists
- Inherits from Keys
- BLPOP
- BRPOP
- BRPOPLPUSH
- LINDEX, INDEX
- LINSERT, INSERT
- LLEN, LEN
- LPOP
- LPUSH
- LPUSHX
- LRANGE
- LREM
- LSET, SET
- LTRIM
- RPOP
- RPOPLPUSH
- RPUSH
- RPUSHX
- Lowercase works too
var RedisList = RedisList;var fooList = 'foo';fooList;
Hashes
- Inherits from Keys
- HDEL, DEL
- HEXISTS, EXISTS
- HGET, GET
- HGETALL, GETALL
- HINCRBY, INCRBY
- HINCRBYFLOAT, INCRBYFLOAT
- HKEYS, KEYS
- HLEN, LEN
- HMGET, MGET
- HMSET, MSET
- HSET, SET
- HSETNX, SETNX
- HVALS, VALS
- HSCAN, SCAN
- Lowercase works too
var RedisHash = RedisHash;var fooHash = 'foo';fooHash;
Set
- Inherits from Keys
- SADD, ADD
- SCARD, CARD
- SDIFF, DIFF
- SDIFFSTORE, DIFFSTORE
- SINTER, INTER
- SINTERSTORE, INTERSTORE
- SISMEMBER, ISMEMBER
- SMEMBERS, MEMBERS
- SMOVE, MOVE
- SPOP, POP
- SRANDMEMBER, RANDMEMBER
- SREM, REM
- SUNION, UNION
- SUNIONSTORE, UNIONSTORE
- SSCAN, SCAN
- Lowercase works too
var RedisSet = RedisSet;var fooSet = 'foo';fooSet;
SortedSet
- Inherits from Keys
- ZADD, ADD
- ZCARD, CARD
- ZCOUNT, COUNT
- ZINCRBY, INCRBY
- ZINTERSTORE, INTERSTORE
- ZLEXCOUNT, LEXCOUNT
- ZRANGE, RANGE
- ZRANGEBYLEX, RANGEBYLEX
- ZRANGEBYSCORE, RANGEBYSCORE
- ZRANK, RANK
- ZREM, REM
- ZREMRANGEBYLEX, REMRANGEBYLEX
- ZREMRANGEBYRANK, REMRANGEBYRANK
- ZREMRANGEBYSCORE, REMRANGEBYSCORE
- ZREVRANGE, REVRANGE
- ZREVRANGEBYSCORE, REVRANGEBYSCORE
- ZREVRANK, REVRANK
- ZSCORE, SCORE
- ZUNIONSTORE, UNIONSTORE
- ZSCAN, SCAN
- Lowercase works too
var RedisSortedSet = RedisSortedSet;var fooSortedSet = 'foo';fooSortedSet;
Pub/Sub
Not yet implemented
License
MIT