GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Returning key identifier as part of data returned by query · Issue #594 · googleapis/google-cloud-node Closed Labels api: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue. Milestone DescriptionI use the key identifier extensively throughout my app as my "id". The namespace and kind doesn't change. Is it possible to return the key identifier inline with the data returned from queries or should I just include the identifier as a property on the entity ? For example, if you look at this simple example of an entity returned by a query: What I would like is for my data object to look like: At the moment to include the key identifier with my data object I need to do something like: NOTE - I use pop() here since it's in the examples but I think it's a bad idea. Poping the identifier removes it from the path array. If I go on to reuse the key, it's incomplete (e.g. if I did a get and update). I think entity.key.path[entity.key.path.length - 1] is a better idea. Anyway, if I am returning thousands of entities I can write (using async.js) something like: The problem I have is that (1) this is quite cumbersome (2) I haven't benchmarked but I'm sure there is a performance hit. Is there a better way to do this ? Activity
MetadataMetadataAssigneesLabelsapi: datastoreIssues related to the Datastore API.type: questionRequest for information or clarification. Not an issue. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |