dataSources.documentsPage
Pages through the corpus's documents with a cursor.
Returns one page of the corpus's documents plus a nextCursor, so a large corpus can be walked without loading every document at once. documents() returns them all; reach for this when there are too many to hold in memory.
Parameters
cursor
string | null
Cursor from the previous page; omit for the first.
limit
number
Page size.
order
'oldest' | 'newest'
Order to page in.
Walk a large corpus
let cursor: string | null = null; do { const page = await Docs.documentsPage({ cursor, limit: 100 }); cursor = page.nextCursor; } while (cursor);