Make Collections iterable
See original GitHub issueCurrently cannot use code similar to this to loop a Collection:
let dataRows = await MyTable.where({someValue: 7}).fetchAll();
for (let row of dataRows) {
// do something on row
}
Get: TypeError: dataRows is not iterable
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Collection to Iterable - java - Stack Overflow
Iterable is a super interface to Collection , so any class (such as Set or List ) that implements Collection also implements Iterable...
Read more >Collections - Iterable Support Center
Navigate to Content > Catalogs. · Click Collections (on the left-hand side of the screen). · Use the Filter box to filter the...
Read more >Java Iterable - Jenkov.com
The Java Iterable interface represents a collection of objects which is iterable - meaning which can be iterated.
Read more >Converting Iterable to Collection in Java | Baeldung
Learn how to convert an Iterable to a Collection with a core Java solution or other libraries.
Read more >Iterable collections - Dart programming language
An Iterable is a collection of elements that can be accessed sequentially. In Dart, an Iterable is an abstract class, meaning that you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That would be valid in that it would make the awaited Promises within each forEach iteration synchronous. But each iteration would be asynchronous to the main function without a way to await each iteration.
Try this for example. Each iteration will wait for the timeout to resolve back with the row to rowValue then print it. So synchronous within an iteration. But they will print in the order 1,2,3,4 (not the iteration order) because each iteration is asynchronous relative to the others. And you will see ‘after loop’ print before any of them cause the main code can’t await each iteration either.
Duplicate of #1525.