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

Query with ID as a string is not working anymore #998

Closed
eloone opened this issue Dec 7, 2015 · 1 comment
Closed

Query with ID as a string is not working anymore #998

eloone opened this issue Dec 7, 2015 · 1 comment
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@eloone
Copy link

eloone commented Dec 7, 2015

In previous versions (^0.8.1) I could make a query with an ID as a string coming directly from the request:
ds.get(ds.key({ namespace: 'namespace', path: ['kind', 'kindName', 'entity', '5757334940811264']}), callback)
would work. But with the latest release (^0.25.1) I have to transform the ID in number for the query to work:
ds.get(ds.key({ namespace: 'namespace', path: ['kind', 'kindName', 'entity', 5757334940811264]}), callback)

Is this intended?

@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Dec 7, 2015
@stephenplusplus
Copy link
Contributor

Yes, this is intentional. String IDs are called "names", while numeric IDs are "ids". We use the type of input we receive (number or string) to determine if it's an id or name. An issue was reported a couple of months ago that found the bug in our code: #874

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.
Projects
None yet
Development

No branches or pull requests

2 participants