14 lines
386 B
JavaScript
14 lines
386 B
JavaScript
import redis from 'apigo.cc/gojs/redis'
|
|
import co from 'apigo.cc/gojs/console'
|
|
|
|
redis.setDefault('redis://127.0.0.1:6379/2')
|
|
redis.set('aaa', 111)
|
|
let r = redis.get('aaa')
|
|
if (r !== 111) return 'failed to get value ' + r
|
|
|
|
redis.hMSet('bbb', 'b1', 111, 'b2', 222)
|
|
let [b1, b2] = redis.hMGet('bbb', 'b1', 'b2')
|
|
if (b1 !== 111 || b2 !== 222) return 'failed to get hash value'
|
|
|
|
return true
|