I want to set different TTL value on every save operation of particular document. Like I have one document containing employee and designation fields.
For every new employee, based on designation value TTL should be set accordingly. Like if employee is Solution Architect then document expiry should be set for 30 Days. If designation is "Senior Architect" then expiry should be set as 20 Days.
I know how to set expiry through spring Framework, but how to set it dynamically? PFB:
@Document(expiry = Constants.COUCHBASE_RESOURCE_TTL)
public class EmployeeResource {
}