CursorSelector
Defined in: runtime/selector.ts:56
The most abstract form of access to an unbounded list. This provides the basic mechanics for all pagination in the platform.
A naive access pattern for this would be:
const firstPage = await somethingThatReturnsASelector().limit(100).execute(); const secondPage = await somethingThatReturnsASelector().limit(100).cursor(firstPage.cursor).execute();Note that selectors are chainable and immutable. This the following will work:
const selector = somethingThatReturnsASelector().limit(100); const firstPage = await selector.execute(); const secondPage = await selector.cursor(firstPage.cursor).execute();Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult
Methods
Section titled “Methods”cursor()
Section titled “cursor()”cursor(
value):this
Defined in: runtime/selector.ts:57
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
execute()
Section titled “execute()”execute():
CursorSelectorResult<TResult>
Defined in: runtime/selector.ts:58
Returns
Section titled “Returns”CursorSelectorResult<TResult>
first()
Section titled “first()”first():
Promise<TResult|undefined>
Defined in: runtime/selector.ts:59
Returns
Section titled “Returns”Promise<TResult | undefined>
iterator()
Section titled “iterator()”iterator():
AsyncGenerator<TResult,void,undefined>
Defined in: runtime/selector.ts:60
Returns
Section titled “Returns”AsyncGenerator<TResult, void, undefined>
limit()
Section titled “limit()”limit(
value):this
Defined in: runtime/selector.ts:61
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this