Skip to main content
Lists answer a page at a time, and not all of them page the same way. Every list method has an …All() twin that walks it for you: an async iterator that fetches a page as you go and stops after the last.
It takes the list’s own arguments, minus the page or cursor. break stops it: no further page is fetched.

Only some fields

When you need only a few fields of every document, its id above all, each list method that takes fields also has a …Pick() twin. It walks every page too, 100 documents a page, and resolves one plain object per document: its id and the fields you named.
The rows aren’t models: each value is as the site sends it (a date is its ISO text). More in Find an id.

How each list pages

Content lists and members (until pages), the media lists (from total and perPage; their page size is limit), form submissions, the request log, the access and conversion viewers.
It can never loop: an answer for another page than the one asked for, or the same cursor twice, throws. An answer that names its page but no page count throws too, rather than stopping quietly.

One page

Watching every call

onResponse runs once per attempt with { site, method, path, status, ms }. Wire it to your logger:

Next: testing

Three-line tests with fakeSite().