-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I am trying to get data from Datastore using the code below. However, it seems like something is not working properly.
var gcloud = require('gcloud')({
projectId: myProjectId
})
var dataset = gcloud.datastore.dataset()
var employeeQuery = dataset.createQuery('Employee')
dataset.runQuery(employeeQuery, function(err, entities) {
console.log(err)
console.log(entities)
})
And here is the result.
{ [Error: Error during request.]
errors: undefined,
code: undefined,
message: 'Error during request.',
response: undefined }
undefined
I am running this on an Compute Engine instance, so there's should not be any problems with the authentication. I have tried using the Python library for Gcloud and there's no problems with it.
Also, I can use the code below to create a new entity but the 'err' in callback still give the same error, although the entity is already created.
var dataset = gcloud.datastore.dataset()
var key = dataset.key('Employee')
dataset.save({
key: key,
data: {
name: 'Bob',
age: 20
}
}, function(err) {
console.log(err)
})
Am I doing something wrong here ?
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.