Skip to content

Is the GCE + Datastore example code functional ? #615

Description

@jgeewax

The example code we have is

// Auth is handled automatically inside GCE.
var gcloud = require('gcloud');
var dataset = gcloud.datastore.dataset();
var productKey = dataset.key(['Product', 123]);

dataset.get(productKey, function(err, entity) {
  console.log(err, entity);
});

Is that accurate? Don't we need to define a project ID and/or dataset ID ?

I ask because we had the debate about how we don't auto-discover the project ID...

Activity

  1. added this to the Core Stable milestone on May 20, 2015
  2. 7 remaining items

  3. added a commit that references this issue on Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions