title: How to set expiry for the CouchBase using couchnode
body: <p>I am storing the data in CouchBase from Node.js app using the following codes (<a href="https://github.com/couchbase/couchnode" rel="nofollow">couchnode</a> client):</p>
  
  <pre><code>    //Expiry information of couchbase doucumenets. fetched from config.json
      //Expiry is less than 30*24*60*60 (30 days)
      //The value is interpreted as the number of seconds from the point of storage or update.
      //Expiry is greater than 30*24*60*60
      //The value is interpreted as the number of seconds from the epoch (January 1st, 1970).
      //Expiry is 0
      //This disables expiry for the item. 
      CouchBaseDB.set(keytosave, 60, doctosave, function (err, meta) {
          if (err) { console.log(err); } else {console.log('saved');}
      });
  </code></pre>
  
  <p>Unfortunately, the above code is not working (its saving 60 itself instead of object <code>doctosave</code>) and no where its explained how to set expiry othere than <a href="http://www.couchbase.com/docs/couchbase-sdk-java-1.0/couchbase-sdk-java-summary-expiry.html" rel="nofollow">Chapter 4. Java Method Summary - 4.4. Expiry Values</a>.</p>
  
  <p>Does any one came across the same and found any work-around/solution or any document support for the same. If explained it would be of great HELP.</p>
  
  <p>Thanks in advance.</p>