google-cloud-node icon indicating copy to clipboard operation
google-cloud-node copied to clipboard

Query with ID as a string is not working anymore

Open eloone opened this issue 10 years ago • 1 comments

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?

eloone avatar Dec 07 '15 00:12 eloone

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: https://github.com/GoogleCloudPlatform/gcloud-node/issues/874

stephenplusplus avatar Dec 07 '15 01:12 stephenplusplus