One thing I came up with is that you will have the same problem as using skip() here if you are not going to change the way your interface works.
Using queries such as this requires a different type of interface, since now itβs more difficult for you to determine which page you are on and how many pages there are in the future, especially if you do this to avoid problems with regular paging.
The default interface type arising from this type of swap is just an endlessly scrollable page, think about comments on videos on YouTube or on Facebook or on Google+. There is no physical pagination or "page", instead you have a "More" button.
This is the type of interface you need to use to improve your ranking mode.
Regarding the @cubbuk request, it gives a good example:
datastore.find(YourClass.class).field(id).smallerThan(lastId).limit(10).order("-ts");
Also, this should be greaterThan(lastId) , since you want to find everything above the last _id . I also sort _id if you donβt do your OjbectIds sometime before inserting the record, if so, then you can use the specific timestamp set for the insert.
Sammaye
source share