I try to use redis sorted set command zadd. But keeping throw error when i run this script:
var ts = Math.round(Date.now() / 1000)
, key = 'usr::' + dest.ID + '::msgs'
, id = uuid.v1();
var notify = {
msg: response.msg,
from: response.from ? response.from : null,
type: response.type ? response.type : null,
date: ts,
read: 0
}
client.zadd(key, ts, JSON.stringify(notify), function (err, response) {
if (err) throw err;
});
Is anything wrong with this code?
By the way: What i try to accomplish is notification/inbox system... So better save time from asking me like you will help and finally you don't :(
ERROR: ERR Operation against a key holding the wrong kind of value