promisifyAll Example less createClient
HoKangInfo opened this issue · 2 comments
HoKangInfo commented
const redis = require('redis');
Aigle.promisifyAll(redis);
const key = 'test';
redis.hsetAsync(key, 1)
.then(() => redis.hgetAsync(key))
.then(value => console.log(value)); // 1
must createClient
const redis = require('redis').createClient()
Aigle.promisifyAll(redis)
suguru03 commented
Hi @HoKangInfo !
Thanks for the issue. 🙂
I'm preparing a new doc website, I'll add the example as well.
I'm also using the node_redis
library, the usage is as below,
const redis = require('redis');
Aigle.promisifyAll(redis);
const client = redis.createClient();
client.hsetAsync(key, 1)
.then(() => client.hgetAsync(key))
.then(value => console.log(value)); // 1