On Feb 10, 3:10 am, "Nick Johnson (Google)" <[email protected]> wrote: > The cursor format is internal, and it's not really amenable to being parsed > like this, since it will vary depending on the type of query you're > executing.
+1. the cursor format is an implementation detail. you definitely can decode a cursor, muck with it, and re-encode it, and it will work. that's definitely unsupported, though, so we'd discourage it. On Feb 16, 8:46 am, "Nick Johnson (Google)" <[email protected]> wrote: > As you point out, in order to use a cursor, you still have to > reconstruct the original query, so a user could not modify a cursor to cause > you to display records they should not have access to. +1. this is important. > It contains the complete key of the next record to be returned, along with > some extra information about the query. Feel free to experiment and see for > yourself, of course. :) specifically, the "extra information" is your app id and the kinds and some property values, and possibly also property names, of one or more entities that were query results. the specific properties involved are the properties in the query. On Feb 16, 3:02 pm, Waldemar Kornewald <[email protected]> wrote: > what's the advantage of cursors compared to key-based pagination? The > latter at least allows for paginating backwards from any point. Why > don't cursors just build on the same principle? the main advantage is that cursors are a built in, turnkey solution. key-based pagination takes much more work on the developer's part: extracting all of the property values and key required to resume the query, packing them up together and serializing them, then later injecting them back into the query as filter values to resume. what's more, key-based pagination often requires an extra custom index. you're right, though, key-based pagination does support paging backward, even if it generally requires yet another custom index. cursors don't easily support paging backward right now, but they definitely could. we can think about adding that in the future. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
