Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datastore: accept entity object to mutation methods #1804

Merged
merged 1 commit into from
Nov 17, 2016

Conversation

stephenplusplus
Copy link
Contributor

Fixes #1803

To make get & updating entities easier:

Before

datastore.get(key, function(err, entity) {
  entity.color = 'red'

  datastore.save({
    key: entity[datastore.KEY],
    data: entity
  }, function(err) {})
})

After

datastore.get(key, function(err, entity) {
  entity.color = 'red'
  datastore.save(entity, function(err) {})
})

@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Nov 17, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 17, 2016
@callmehiphop callmehiphop merged commit aacb8cc into googleapis:master Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants