I am trying to expire my documents in 7 years. But when I check the expiration which I set when upserting the document, it don’t give me a right milliseconds.
Here is what I tried so far,
var totalSeconds = (DateTime.UtcNow.AddYears(7) - DateTime.UnixEpoch).TotalSeconds;
var expiryTimestamp = TimeSpan.FromSeconds(some)
IOperationResult<dynamic> result = await _bucket.UpsertAsync(docId, data, expiryTimestamp )
Upon checking in the metadata in web console for expiration, it is giving me 3422993998 (Feb, 09, 1970)milliseconds.
The second approach I tried is this:
var expiry = (DateTime.UtcNow.AddYears(7) - DateTime.UnixEpoch).TotalMilliseconds;
var doc = new Document<dynamic>{ Id = docId, Expiration= expiry, Content=data }
This approach also didn’t work and also gives me same result as 1st approach. . Can anyone help understand what am I doing wrong here?
Thank you