-
Notifications
You must be signed in to change notification settings - Fork 641
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
- OS: OS X
- Node.js version: 6.6.0
- npm version: 3.10.3
- google-cloud-node version:
"@google-cloud/datastore": "^0.7.0",
"@google-cloud/storage": "^0.6.0",
Steps to reproduce
- require
google-cloud - Create an entity in the datastore with an auto-generated long ID.
let key = this._datastore.key(['SomeEntity']);
let dsEntity = {
key: key,
data: {...},
};
this._datastore.upsert(dsEntity).then...- Run a query that would fetch the entity:
this._datastore.runQuery(query).then((response) => {
let entities = response[0];
let results = [];
entities.forEach((entity) => {
const resolved = {
key: entity[Datastore.KEY], // <-- THIS KEY.ID IS NOW A STRING
data: entity,
};4 Attempt to fetch the entity identified by the key returned in step 3.
this._datastore.get(resolved.key) // <-- THIS WILL FAIL BECAUSE ID IS A STRINGWe believe this is related to #1413, specifically, https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fgoogle-cloud-node%2Fcommit%2Fbab982faba1c6ef3c393da816535be3704113787&sa=D&sntz=1&usg=AFQjCNGTKOrx2uKSEd7TrDMwbFqat44fVw
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.