SG 2.0 - TTL - expiry()

This works adding a ttl of 10 minutes.

function(doc){
var currentDate = new Date();
var d = new Date(currentDate.getTime() + (10 * 60 * 1000));
expiry(d.toISOString())
channels(doc.channels)
}

This doesn’t work

function(doc){
expiry(600)
channels(doc.channels)
}

A fix for this has gone into 2.1, you can wrap absolute values in double quotes as a workaround. E.g: expiry("600")

1 Like