Skip to content

Commit 0d024b4

Browse files
Merge pull request #697 from stephenplusplus/spp--datastore-document-keys-only-query
docs: datastore: document keys-only query
2 parents b4a42ce + 5303702 commit 0d024b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/datastore/request.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,17 @@ DatastoreRequest.prototype.delete = function(keys, callback) {
503503
* //-
504504
* transaction.runQuery(query)
505505
* .on('data', function (entity) {});
506+
*
507+
* //-
508+
* // A keys-only query returns just the keys of the result entities instead of
509+
* // the entities themselves, at lower latency and cost.
510+
* //-
511+
* var keysOnlyQuery = dataset.createQuery('Lion').select('__key__');
512+
*
513+
* transaction.runQuery(query, function(err, entities, endCursor, callback) {
514+
* // entities[].key = Key object
515+
* // entities[].data = Empty object
516+
* });
506517
*/
507518
DatastoreRequest.prototype.runQuery = function(q, callback) {
508519
var that = this;

0 commit comments

Comments
 (0)