1
votes

I have saved a document with expiry time of 20 seconds as shown below in my java code.

@Document(expiryExpression = "20",expiryUnit = TimeUnit.SECONDS)

public class Myclass {

it is deleting the document after 20 second which is fine.

But if i execute a N1ql within 20 seconds, the document is not getting deleted. Execution time of N1ql is just 1 second.

Update Delivery d SET VehicleTrip.tripStatus = 'ENDED' where meta(d).id = 'DD_1111_145469_2017-07-11'

my query is working fine, but the problem is document is not deleted once it complete 20 seconds.

2

2 Answers

1
votes

Expiration time means that the document will be not available in memory storage in 20 seconds, it does not guarantee the same time for all persistent indexes, they might lag a bit.

0
votes

N1QL DMLs will not preserve expiration set by the SDK. If you modified document through N1QL you need to set the expiry again.