Couchbase lite version: 2.0.0-DB021
Suppose we have a query
getAllDocuments() that selects all my documents. This query is called onStart() of my application.
I’d like to add a where filter that selects only the document with
created_at field greater that the actual time.
For example, if now it was “2018-01-10T10:00:00”, a document with created_at = “2018-01-10T10:00:00” should be selected, instead a document with created_at = “2018-01-10T10:15:00” should not.
My actual query is:
Query.select(SelectResult.all()) .from(DataSource.database("my_db")) .where(Expression.property("created_at").greaterThan(ACTUAL_TIME)
My first thought was to add an internal timer in android that run the query every X minutes.
My question is if there is a way to instruct couchbase to run a determinate query every X interval without using an external timer.