Is there a way to exit a querysnapshot loop prematurely?
I attempted using a for loop, but I keep encountering the following error message.
How can this error be resolved or is there an alternative method to break out of a snapshot loop?
code
return query.get()
.then((snapshot) => {
for(const doc of snapshot) {
let data = doc.data()
if (data.age == 16) {
break;
}
}
error
Type 'QuerySnapshot' must have a 'Symbol.iterator' method that returns an iterator.