I’m trying to count all documents that have a lastModifiedDate before a certain date by using the .compareTo function in a parameterized query like so:
Statement query = select(x(“COUNT(*)”).as(“count”)).from(i(bucket.name()))
First I format deletionDate so it has the same format as lastModifiedDate, then I compare the two as strings. The problem is that when debugging I see that the comparison evaluates to 46, and the query doesn’t return anything, when it should return several documents from the database. This means that identifier doesn’t work and the expression is not inserting the respective value of lastModifiedDate as it goes through all the documents.
Any help would be much appreciated.