Skip to content

datastore: runQuery should return complete objects rather than objects and keys #38

@jasonpolites

Description

@jasonpolites

The callback for runQuery returns keys and objects as separate collections:

https://github.com/GoogleCloudPlatform/gcloud-node#querying

This is a little problematic if you want to return "whole" objects back to the client. Perhaps this is a Datatstore specific thing, but in almost all cases the client will want the key in the object. Do I have to iterate the collections and re-constitute the object by inserting a "key" (or "id") property?

E.g what I want on the client is something like this:

{
    "_id" : 5654313976201216,
    "foo" : "bar"
}

what I get is:

{
    "foo" : "bar"
}

with the ID/key in a separate (symmetrical) collection.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions