Closed leocabral closed 8 years ago
@matheusmr13
Today the solution is to work with an Action and the Java API.
Planning to work on this issue soon..
[ ]s
Fix 0402b99
Currently the solution is this:
q
json to the server, so that a cursor is returned (I made it this way for backwards compatibility);results
) and a second element, cursor
, that is the cursor for the next query;Something like this:
String cursor = "";
for (int i = 0; i < total; i += limit) {
String json = get("/parents", params("q", "{ limit: " + limit + ", cursor: '" + cursor + "' }"));
process(asJsonObject(json).get("results")); // process
cursor = asJsonObject(json).get("cursor").getAsString(); // next cursor
}
If @feroult, @leocabral or @matheusmr13 see a better way to do it without breaking the previous API, please care to comment :)
@luanpotter, I think this is a pretty good solution, not only for back compatibility. :dart:
If we send a query param with limit (/endpoint/?q={"limit": 3}) it does not return any cursor in the results json... it would be nice to have it :wink: