But, it works great on the server. The mock should add the doc, with the proper expiry. There is some tricky stuff here - if the expiry you set is less than 30 days worth of seconds from now, it is just that. If it is larger than that, it is assumed to be a date in seconds since 1/1/1970. And it is returned the same way.