【发布时间】:2019-02-14 10:34:18
【问题描述】:
我想跳出 forEach 循环。考虑一下:
db.collection('users').get().then(querySnapshot => {
if (!querySnapshot.empty) {
querySnapshot.forEach(doc => {
let data = doc.data()
if (data.age == 16) {
break //this is not working
}
})
}
}
)
documentation 没有提及中断 forEach 循环
【问题讨论】:
标签: javascript node.js firebase google-cloud-firestore