Skip to content

datastore: accept entity object to mutation methods#1804

Merged
callmehiphop merged 1 commit intogoogleapis:masterfrom
stephenplusplus:spp--1803
Nov 17, 2016
Merged

datastore: accept entity object to mutation methods#1804
callmehiphop merged 1 commit intogoogleapis:masterfrom
stephenplusplus:spp--1803

Conversation

@stephenplusplus
Copy link
Copy Markdown
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
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
🤖 I have created a release *beep* *boop*
---


## [4.0.1](https://togithub.com/googleapis/nodejs-pubsub/compare/v4.0.0...v4.0.1) (2023-08-11)


### Bug Fixes

* **deps:** Update dependency @google-cloud/paginator to v5 ([#1799](https://togithub.com/googleapis/nodejs-pubsub/issues/1799)) ([3195d21](https://togithub.com/googleapis/nodejs-pubsub/commit/3195d21bf817cf10daa86b019532c9405dc42405))
* **deps:** Update dependency @google-cloud/precise-date to v4 ([#1803](https://togithub.com/googleapis/nodejs-pubsub/issues/1803)) ([2c22d67](https://togithub.com/googleapis/nodejs-pubsub/commit/2c22d67b0fbaf3409101a830ee0c5be002ed6c7b))
* **deps:** Update dependency @google-cloud/projectify to v4 ([#1800](https://togithub.com/googleapis/nodejs-pubsub/issues/1800)) ([5787d56](https://togithub.com/googleapis/nodejs-pubsub/commit/5787d56b95d46544bf8c59fe4bc4cb374bc53d0a))
* **deps:** Update dependency @google-cloud/promisify to v4 ([#1798](https://togithub.com/googleapis/nodejs-pubsub/issues/1798)) ([093c46b](https://togithub.com/googleapis/nodejs-pubsub/commit/093c46bd0a4713ad9702bde03eaa5e8b0acedb28))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
feywind pushed a commit that referenced this pull request Mar 27, 2026
🤖 I have created a release *beep* *boop*
---


## [4.0.1](https://togithub.com/googleapis/nodejs-pubsub/compare/v4.0.0...v4.0.1) (2023-08-11)


### Bug Fixes

* **deps:** Update dependency @google-cloud/paginator to v5 ([#1799](https://togithub.com/googleapis/nodejs-pubsub/issues/1799)) ([3195d21](https://togithub.com/googleapis/nodejs-pubsub/commit/3195d21bf817cf10daa86b019532c9405dc42405))
* **deps:** Update dependency @google-cloud/precise-date to v4 ([#1803](https://togithub.com/googleapis/nodejs-pubsub/issues/1803)) ([2c22d67](https://togithub.com/googleapis/nodejs-pubsub/commit/2c22d67b0fbaf3409101a830ee0c5be002ed6c7b))
* **deps:** Update dependency @google-cloud/projectify to v4 ([#1800](https://togithub.com/googleapis/nodejs-pubsub/issues/1800)) ([5787d56](https://togithub.com/googleapis/nodejs-pubsub/commit/5787d56b95d46544bf8c59fe4bc4cb374bc53d0a))
* **deps:** Update dependency @google-cloud/promisify to v4 ([#1798](https://togithub.com/googleapis/nodejs-pubsub/issues/1798)) ([093c46b](https://togithub.com/googleapis/nodejs-pubsub/commit/093c46bd0a4713ad9702bde03eaa5e8b0acedb28))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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