Skip to content

Datastore fails when saving entity with null attribute value #1022

@toboid

Description

@toboid

When trying to save an object that has null property values gcloud-node errors:

dataset.insert({
  key: dataset.key('Test'),
  data: { foo: 'bar', baz: null }
}, err => {
  if (err) return console.log(err);
});

prints:

Error: Unsupported field value, null, is provided.

I can see that the definition for Value in the Datastore proto buffers api does not provide for null values. The Ruby and Python clients create a message with no value attribute, is this an option for gcloud-node? I'd be really pleased to take a look at this if you'll take a pull request?

Metadata

Metadata

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions