Redis expire and increment
<p>I have a scenario where, i want to implement a caching mechanism with redis. To go into further detail</p>

<p>First i check for the specific key using <strong>client.get()</strong> and if the value doesn't exists. I need to make a call to a web service, which returns a value and is stored as the child of the key. Then i use <strong>client.set()</strong> to set this key into redis. Now this key needs to expire if it has been set for more than 24hours, how can i do this?</p>

<p>Here is an example of the key-value would look like in redis</p>

<pre><code>parentValue:{
    child1:{
        serviceVal: "serviceVal",
        counter: 0
    },

    child2:{...},
    child3:{...}
    .... 
}
</code></pre>

<p>Now similarly when the initial <strong>client.get()</strong>, is performed and if the value exists and this specific key hasn't expired. I want to increment the <strong>counter</strong> in the object and update this specific key in redis. How can i do this?</p>