I am coming from a traditional SQL background and am learning Redis. Specifically I am trying to run a redis database along with node.js
I have got the initial setup of redis done and tried out few of their basic commands. However I would like to create a database which has a Id, 3 marks of students, start date and end date.
I believe I can create an object which stores all the values for a particular ID (say obj) and use set function to save details regarding that ID.
client.set(ID, obj, function(err, reply) {
console.log(reply);
});
If I call client.get(ID) , it will return the object which I saved above. However I would like to get values for the ID from a particular start date and end date.
In SQL it would be like: SELECT * FROM TABLE WHERE StartDATE>='' and endDate='' and id= ID;
What would be the alternative in redis? I haven't been able to find any query example for redis in node.js
Also while inserting into the database, is inserting the object as a whole the best way to go about?