ObjectBoxRxJava icon indicating copy to clipboard operation
ObjectBoxRxJava copied to clipboard

Can't use find on a query

Open kakai248 opened this issue 8 years ago • 1 comments

With the current Rx implementation, it's not possible to use find for pagination.

Take RxQuery.single for example. Since we pass Query<T> and receive a Single<List<T>>, we can't apply that operator.

I really don't have a suggestion on how to fix this decently. Right now, I'm doing:

Single.just(box.query()
                .build()
                .find(from, to)
)

Truth is that I would prefer a somewhat different Rx implementation. Something along the ways of requery (https://github.com/requery/requery).

Thank you.

kakai248 avatar Sep 07 '17 13:09 kakai248

We are currently tracking a change to set offset and limit while building the query, instead of when calling find. See https://github.com/objectbox/objectbox-java/issues/303 -ut

greenrobot-team avatar Jul 02 '18 10:07 greenrobot-team