Results are fetched a page at a time, as they are consumed, so iterating and stopping early
costs only the pages you actually read.
A collection can be consumed only once. Iterating and toArray
advance the same cursor, so collecting after a partial iteration yields only what is left of
the collection rather than all of it.
Example: Iterate lazily, stopping as soon as you have what you need
forawait (constdatasetofaccount.getDatasets()) { if (dataset.slug === 'iris') break }
Type Parameters
ResultType
the shape of a single result in the API response, before it is mapped.
Output
what iterating yields: a Dataset, a Query, a binding, and so on.
A lazy, paginated collection of results.
Remarks
Returned by every method that yields a collection — an Account's
getDatasets, Dataset.getGraphs, Dataset.getAssets and so on. Never constructed directly.Results are fetched a page at a time, as they are consumed, so iterating and stopping early costs only the pages you actually read.
A collection can be consumed only once. Iterating and toArray advance the same cursor, so collecting after a partial iteration yields only what is left of the collection rather than all of it.
Example: Iterate lazily, stopping as soon as you have what you need