0.9.2 • Published 6 years ago

ym-redis v0.9.2

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

Redis 快速存储模块

引入


var REDIS = require('@ym/redis');
var redis = new REDIS({
	port: port,
	host: host,
	db: db,
	retry_max_value: retry_max_value,
	password: authpassword,
	prefix: prefix
});

Usage


SET

redis.set(key,value).then(status=>{
	status......
});

if set success, status = 'ok'

GET

redis.get(key).then(value=>{
	value......
});

EXPIRE

为存储内容设置过期时间(s)

redis.expire(key,expire_time);

为存储内容设置过期时间(ms)

redis.pexpire(key,expire_time);

HMSET

redis.hmset(hash,objectValue,expire).then(status=>{
	status......
});

Most new features added on

expire,pexpire,expireat,pexpireat,move,exists,type,persist,pttl,ttl,randomkey,hmset,hmget,set,get,delete click here to docs about

0.9.2

6 years ago