Repository navigation
How are query start cursorTokens used? #1208
Copy link
Copy link
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
Description
Activity
I've just spent a bit of time looking into the issue and did get it working. Here is what I came up with:
var cursorToken = req.cursorToken ? new Buffer(req.cursorToken, 'base64') : null; datastore.runQuery( datastore.createQuery('User').start(cursorToken).limit(1), function(error, entities, nextQuery) { var result = {}; result.cursorToken = new Buffer(nextQuery.startVal).toString('base64'); res.status(200).json(result); );It might make things a bit more straightforward and easier to work with if the start method would accept both base64 and buffer parameters. It might also be convenient for the
nextQueryto include a base64 version called endCursorToken and startCursorToken so that it matches up a bit more with the documentation.I think we should just go back to only accepting base64 strings and skip buffers altogether. Any interest in putting a PR together?
- addedapi: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
on Apr 6, 2016 I'll take a shot at making a PR for this and see what happens.
Thanks! Feel free to send it in even if it's not perfect. I can always help with the grunt work (code style, tests, etc).
Fixed via a80ff9b
- added a commit that references this issue
on Feb 3, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
My application is using express and I'm having some troubles getting the latest
~0.30.0releases to return a cursor value I can pass back to the client for usage. If I recall correctly the previous releases were using a base64 string. What kind of cursorToken should I be passing a start query now?https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.30.2/datastore/query?method=start
Maybe I should manually convert it myself now?
new Buffer(cursor.startVal).toString('base64')