Details
-
Bug
-
Resolution: Fixed
-
Test Blocker
-
None
-
None
-
*Location*: https://docs.couchbase.com/java-sdk/3.0/howtos/kv-operations.html
*Referrer*: https://docs.couchbase.com/java-sdk/3.0/hello-world/start-using-sdk.html
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
*Screen Resolution*: 1920 x 1080*Location*: https://docs.couchbase.com/java-sdk/3.0/howtos/kv-operations.html *Referrer*: https://docs.couchbase.com/java-sdk/3.0/hello-world/start-using-sdk.html *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36 *Screen Resolution*: 1920 x 1080
Description
While we have documentation discussing the differences between an offset expiry (< 30 days) and the epoch time for greater than 30 days, but we do not have any code examples for the epoch time approach. Can we include some code examples on how to set expiry greater than 30 days. Some example code is included below:
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, 60);
Long time = calendar.getTime().getTime();
System.out.println(time);
try
{ MutationResult result = collection.upsert("test", JsonObject.create().put("test", "testing"), UpsertOptions.upsertOptions().expiry(Duration.ofMillis(time))); System.out.println(result); }catch (Exception e)
{ e.printStackTrace(); }Reporter: Craig Kovar
E-mail: craig.kovar@couchbase.com
Attachments
Issue Links
- relates to
-
JCBC-1645 Expiry durations longer than 30 days are interpreted incorrectly
- Resolved