Basically I'm trying to set an object with a given value but I cannot get it to work even though it seems successful. Here is my javascript object;
function student(){
var newStudent = {};
newStudent.lessons = [1,3,4];
return newStudent;
}
Later on when I want to obtain the students list I fail as console.log prints "undefined" however the object is not null. My code for insertion to redis;
var student = Students.student();
//Object is not null I checked it
client.set("studentKey1", student, redis.print);
client.get("studentKey1", function(err, reply){
console.log(reply.lessons);
});
Two questions;
First, how can I do it properly or is the list structure of Javascript not supported in Redis. Second, if I want to get the item with studentKey1 and insert an item to the back of list how can I accomplist that (how can I utilize RPUSH)?