Skip to content

Datastore endCursor as base64 or buffer string? #20

@stephenplusplus

Description

@stephenplusplus

From @mcfarljw on December 20, 2017 3:20

I feel like every time I don't look at the node cloud datastore library the way the format of the endCursor changes and there is not mention of what it should look like it the documentation. I remember when I first started using it everything was base64 and then it changed to a buffer string. I opened a pull request and it got switched back to base64.

googleapis/google-cloud-node#1209

Now it seems like it has changed back to a buffer string. I still vote for base64 because when returning the cursor to the browser via a custom api it can't be a buffer string. I would settle for sticking with one or the other and clearly documenting the format.

Environment details

  • OS: macOS High Sierra 10.13.2
  • Node.js version: 8.9.3
  • npm version: 5.6.8
  • google-cloud-node version: 1.2.1

Steps to reproduce

const query = datastore.createQuery('User').limit(1)
const result = await query.run()

console.log('CURSOR:', result[1])

Copied from original issue: googleapis/google-cloud-node#2781

Metadata

Metadata

Labels

🚨This issue needs some love.api: datastoreIssues related to the googleapis/nodejs-datastore API.priority: p0Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions