I'm writing a nodejs 5.10.1 application, and i connect to a redis-server.
i'm using the ioredis nodejs module from https://github.com/luin/ioredis.
I can't seem to figure out how to check if a connection was established to the server.
the code to connect to a redis server is pretty simple:
var Redis = require('ioredis');
var redis = new Redis();
the documentation states the following under Connection Events
You can also check out the Redis#status property to get the current connection status.
don't really understand what it means or how to work with it. any ideas ?
One of the properties of the redis object you started is the status
:
console.log(redis.status)
will give you the current , in my case it says : connecting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With