Skip to content

Commit 2239bbf

Browse files
add other moreResults constants
1 parent d190a72 commit 2239bbf

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

lib/datastore/index.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,38 @@ Datastore.int = function(value) {
398398
return new entity.Int(value);
399399
};
400400

401+
/**
402+
* This is one of three values which may be returned from
403+
* {module:datastore#runQuery}, {module:transaction#runQuery}, and
404+
* {module:datastore/query#run} as `info.moreResults`.
405+
*
406+
* There may be more results after the specified end cursor.
407+
*
408+
* @type {string}
409+
*/
410+
Datastore.MORE_RESULTS_AFTER_CURSOR = 'MORE_RESULTS_AFTER_CURSOR';
411+
412+
/**
413+
* This is one of three values which may be returned from
414+
* {module:datastore#runQuery}, {module:transaction#runQuery}, and
415+
* {module:datastore/query#run} as `info.moreResults`.
416+
*
417+
* There may be more results after the specified limit. It's possible for this
418+
* to be returned even though there are not actually results after the limit.
419+
*
420+
* @type {string}
421+
*/
422+
Datastore.MORE_RESULTS_AFTER_LIMIT = 'MORE_RESULTS_AFTER_LIMIT';
423+
424+
/**
425+
* This is one of three values which may be returned from
426+
* {module:datastore#runQuery}, {module:transaction#runQuery}, and
427+
* {module:datastore/query#run} as `info.moreResults`.
428+
*
429+
* There are no more results left to query for.
430+
*
431+
* @type {string}
432+
*/
401433
Datastore.NO_MORE_RESULTS = 'NO_MORE_RESULTS';
402434

403435
/**

test/datastore/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ describe('Datastore', function() {
190190
});
191191
});
192192

193+
describe('MORE_RESULTS_AFTER_CURSOR', function() {
194+
it('should expose a MORE_RESULTS_AFTER_CURSOR helper', function() {
195+
assert.strictEqual(
196+
Datastore.MORE_RESULTS_AFTER_CURSOR,
197+
'MORE_RESULTS_AFTER_CURSOR'
198+
);
199+
});
200+
});
201+
202+
describe('MORE_RESULTS_AFTER_LIMIT', function() {
203+
it('should expose a MORE_RESULTS_AFTER_LIMIT helper', function() {
204+
assert.strictEqual(
205+
Datastore.MORE_RESULTS_AFTER_LIMIT,
206+
'MORE_RESULTS_AFTER_LIMIT'
207+
);
208+
});
209+
});
210+
193211
describe('NO_MORE_RESULTS', function() {
194212
it('should expose a NO_MORE_RESULTS helper', function() {
195213
assert.strictEqual(Datastore.NO_MORE_RESULTS, 'NO_MORE_RESULTS');

0 commit comments

Comments
 (0)