There is a discrepancy between the server documentation and the SDK documentation ( here too) regarding TTL. The SDK expects milliseconds to be passed in and it will handle the conversion specified in the server documentation to Unix time; this is for convenience. The reason the SDK uses milliseconds is because it’s a more standardized way of specifying a TTL than seconds from an API perspective.
Note that there are additional overloads (but none for Document), which take a TimeSpan as the TTL; for those methods it’s preferable over the overloads that take a unsigned int.
I opened up a ticket to address this here. Sorry for any confusion this may have caused.
Actually I believe uint is 49 days; agreed ulong would be better. The suggested work around is to use one of the overloads that takes a K/V pair and not a document and includes a TimeSpan for an expiry.
I created a ticket here to add a property to IDocument and/or change the Type to ulong: http://issues.couchbase.com/browse/NCBC-954. This would be a potentially breaking change, so it won’t likely be addressed until the next major release.