How to set expiry for the CouchBase using couchnode

I am storing the data in CouchBase from Node.js app using the following codes (couchnode client):

    //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');}
    });

Unfortunately, the above code is not working (its saving 60 itself instead of object doctosave) and no where its explained how to set expiry othere than Chapter 4. Java Method Summary - 4.4. Expiry Values.

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.

Thanks in advance.

Set function looks like this:

function set(key, doc, meta, callback) { ... }

If you want to add expiry for stored key just create meta = {} object and add field expiry to it: meta.expiry = 1000.

Here is link to sources

So to store your doc you need:

var meta = {"expiry":60};
CouchBaseDB.set(keytosave, doctosave, meta, function (err, meta) {
  if (err) { console.log(err); } else {console.log('saved');}
});

Note: Also if that key is retreived form couchbase via CouchBaseDB.get(), meta could be extracted from that get function.