@@ -118,14 +118,15 @@ function DatastoreRequest() {}
118118 *
119119 * @example
120120 * //-
121- * // Where you see `transaction`, assume this is the context that's relevant to
122- * // your use, whether that be a Dataset or Transaction object.
121+ * // Get a single entity.
123122 * //-
123+ * var key = dataset.key(['Company', 123]);
124+ *
125+ * dataset.get(key, function(err, entity) {});
124126 *
125127 * //-
126- * // Get a single entity .
128+ * // Or, if you're using a transaction object .
127129 * //-
128- * var key = dataset.key(['Company', 123]);
129130 *
130131 * transaction.get(key, function(err, entity) {});
131132 *
@@ -137,12 +138,12 @@ function DatastoreRequest() {}
137138 * dataset.key(['Product', 'Computer'])
138139 * ];
139140 *
140- * transaction .get(keys, function(err, entities) {});
141+ * dataset .get(keys, function(err, entities) {});
141142 *
142143 * //-
143144 * // Or, get the entities as a readable object stream.
144145 * //-
145- * transaction .get(keys)
146+ * dataset .get(keys)
146147 * .on('error', function(err) {})
147148 * .on('data', function(entity) {
148149 * // entity is an entity object.
@@ -483,16 +484,18 @@ DatastoreRequest.prototype.save = function(entities, callback) {
483484 * @param {object } callback.apiResponse - The full API response.
484485 *
485486 * @example
487+ * dataset.delete(dataset.key(['Company', 123]), function(err, apiResp) {});
488+ *
486489 * //-
487- * // Where you see `transaction`, assume this is the context that's relevant to
488- * // your use case, whether that be a Dataset or a Transaction object.
490+ * // Or, if you're using a transaction object.
489491 * //-
490492 *
491- * // Delete a single entity.
492493 * transaction.delete(dataset.key(['Company', 123]), function(err, apiResp) {});
493494 *
495+ * //-
494496 * // Delete multiple entities at once.
495- * transaction.delete([
497+ * //-
498+ * dataset.delete([
496499 * dataset.key(['Company', 123]),
497500 * dataset.key(['Product', 'Computer'])
498501 * ], function(err, apiResponse) {});
@@ -555,11 +558,13 @@ DatastoreRequest.prototype.delete = function(keys, callback) {
555558 * //-
556559 * var query = dataset.createQuery('Lion');
557560 *
558- * transaction.runQuery(query, function(err, entities) {
559- * if (!err) {
560- * // Handle entities here.
561- * }
562- * });
561+ * dataset.runQuery(query, function(err, entities) {});
562+ *
563+ * //-
564+ * // Or, if you're using a transaction object.
565+ * //-
566+ *
567+ * transaction.runQuery(query, function(err, entities) {});
563568 *
564569 * //-
565570 * // To control how many API requests are made and page through the results
@@ -574,14 +579,14 @@ DatastoreRequest.prototype.delete = function(keys, callback) {
574579 * }
575580 * };
576581 *
577- * transaction .runQuery(manualPageQuery, callback);
582+ * dataset .runQuery(manualPageQuery, callback);
578583 *
579584 * //-
580585 * // If you omit the callback, runQuery will automatically call subsequent
581586 * // queries until no results remain. Entity objects will be pushed as they are
582587 * // found.
583588 * //-
584- * transaction .runQuery(query)
589+ * dataset .runQuery(query)
585590 * .on('error', console.error)
586591 * .on('data', function (entity) {})
587592 * .on('end', function() {
@@ -594,7 +599,7 @@ DatastoreRequest.prototype.delete = function(keys, callback) {
594599 * //-
595600 * var keysOnlyQuery = dataset.createQuery('Lion').select('__key__');
596601 *
597- * transaction .runQuery(keysOnlyQuery, function(err, entities) {
602+ * dataset .runQuery(keysOnlyQuery, function(err, entities) {
598603 * // entities[].key = Key object
599604 * // entities[].data = Empty object
600605 * });
@@ -644,15 +649,16 @@ DatastoreRequest.prototype.runQuery = function(query, callback) {
644649 * @param {object } callback.apiResponse - The full API response.
645650 *
646651 * @example
647- * //-
648- * // Where you see `transaction`, assume this is the context that's relevant to
649- * // your use, whether that be a Dataset or a Transaction object.
650- * //-
651- *
652652 * var incompleteKey = dataset.key(['Company']);
653653 *
654654 * // The following call will create 100 new IDs from the Company kind, which
655655 * // exists under the default namespace.
656+ * dataset.allocateIds(incompleteKey, 100, function(err, keys) {});
657+ *
658+ * //-
659+ * // Or, if you're using a transaction object.
660+ * //-
661+ *
656662 * transaction.allocateIds(incompleteKey, 100, function(err, keys) {});
657663 *
658664 * // You may prefer to create IDs from a non-default namespace by providing an
@@ -664,7 +670,7 @@ DatastoreRequest.prototype.runQuery = function(query, callback) {
664670 * path: ['Company']
665671 * });
666672 * var callback = function(err, keys, apiResponse) {};
667- * transaction .allocateIds(incompleteKey, 100, callback);
673+ * dataset .allocateIds(incompleteKey, 100, callback);
668674 */
669675DatastoreRequest . prototype . allocateIds = function ( incompleteKey , n , callback ) {
670676 if ( entity . isKeyComplete ( incompleteKey ) ) {
0 commit comments