AsyncIterator version of local API #4355
tyteen4a03
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
Isn't that what you want? // with pagination false it returns all docs.
const { docs } = await payload.find({ collection: 'test', pagination: false });
// in parallel
await Promise.all(
docs.map(async (doc) => {
console.log(doc);
await doSomeTask(doc);
}),
);
// sync
for (const doc of docs) {
console.log(doc)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to be able to effortlessly loop over all documents in a collection with the local API, without worrying about pagination.
EDIT: here's a quick and dirty one in the meantime:
Beta Was this translation helpful? Give feedback.
All reactions