I use redis (predis/predis composer) to save some id in php like this:
$redis = new Client();
$mailJson = $redis->get('mail');
$mail = json_decode($mailJson);
$no = rand(100,500);
array_push($mail, $no);
$redis->set('mail', json_encode($mail));
and i retrieve this array like this:
var redis = require("redis"),
client = redis.createClient();
client.on('connect', function() {
client.get('mail', function(err, mailIds) {
console.log(mailIds);
});
});
But mailIds variable is string and not an array like this:
[1,200,500,500,400,100,200,100]
Is way can access mailIds items ?