When we are creating/upserting the document we are setting the expiry using upsertoptions as shown below:
Temporal startTm = Instant.now();
Temporal endTm = Instant.now().plus(Period.ofDays(365));
try {
collection.upsert(id, JsonObject.fromJson(payload), UpsertOptions.upsertOptions().expiry(Duration.between(startTm, endTm)));
} catch (Exception e) {
throw e;
}
So when we run this the data is not saved in couchbase. But if we change the code to :
try {
collection.upsert(id, JsonObject.fromJson(payload));
} catch (Exception e) {
throw e;
}
We are able to save the data successfully.
So please let us know why its not saving data in the first case.