I have a simple requirement to delete all documents whose date is less than specified in the query. but whatever option I try, it’s deleting all documents from db. Code is written in Java Spring Boot project.
Sprinboot-2.4.4. spring data couchbase-4.1.6
sample codes I tried: I tried passing argument as String, LocalDateTime, etc but none of it worked.
dateParam passed as String was: “2021-04-07T06:47:32Z”
I also tried passing LocalDateTime- LocalDateTime.of(2021, 4, 7, 06, 47, 32);
To Test, I tried select query and correct number of documents matching criteria is returned in this case.
It’s surprising it’s working for select query but not for delete query.
If I run query from couchbase UI, only documents that matches condition gets deleted.
delete from DB_NAME where dateParam < 1618188052352
note: date is given in epoch format.
Any help would be appreciated.