Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get entity by key id (int64) from Datastore #1412

Closed
gromtech opened this issue Jul 8, 2016 · 5 comments
Closed

Unable to get entity by key id (int64) from Datastore #1412

gromtech opened this issue Jul 8, 2016 · 5 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@gromtech
Copy link

gromtech commented Jul 8, 2016

For example, datastore already contains an entity with id = 100000000000001234 (18 digits). The integers in JavaScript (numbers without a period or exponent notation) are considered accurate up to 15 digits. 100000000000001234 will be 100000000000001000. Maybe the Long type support (in the cloud.datastore.key method) is a way how to resolve this issue.

@stephenplusplus stephenplusplus added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: datastore Issues related to the Datastore API. labels Jul 8, 2016
@stephenplusplus
Copy link
Contributor

@pcostell does Datastore generate 18 digit IDs?

@gromtech
Copy link
Author

gromtech commented Jul 8, 2016

Datastore allows us to save entities with 18 digit IDs (generated in our Java app). But it is impossible to get those entities in another services (written on NodeJS). Is there a some way to do this? I did not found it...

@stephenplusplus
Copy link
Contributor

Ah, okay. Thanks for the info. I sent a PR to fix this in #1413.

If you'd like to test it out:

$ npm install --save stephenplusplus/gcloud-node#spp--1412
var id = gcloud.datastore.int('100000000000001234');
var key = datastore.key(['Kind', id]);

// everything from this point should work normally.

@gromtech
Copy link
Author

gromtech commented Jul 9, 2016

It works. Thank you.

@jmuk jmuk added priority: p0 Highest priority. Critical issue. P0 implies highest priority. Status: Release Blocking labels Mar 7, 2017
@bjwatson
Copy link

bjwatson commented Mar 7, 2017

Sounds related to #1681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants