Skip to content

Commit

Permalink
Merge pull request #975 from stephenplusplus/spp--datastore-get-examples
Browse files Browse the repository at this point in the history
datastore: docs: show example of updating an entity
  • Loading branch information
callmehiphop committed Dec 1, 2015
2 parents 228c969 + 9838ee1 commit 380592b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/datastore/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ function DatastoreRequest() {}
* .on('end', function() {
* // All entities retrieved.
* });
*
* //-
* // Here's how you would update the value of an entity with the help of the
* // `save` method.
* //-
* dataset.get(key, function(err, entity) {
* if (err) {
* // Error handling omitted.
* }
*
* entity.data.newValue = true;
* dataset.save(entity, function(err) {});
* });
*/
DatastoreRequest.prototype.get = function(keys, callback) {
if (is.fn(callback)) {
Expand Down

0 comments on commit 380592b

Please sign in to comment.