更新时间:2023-02-14 08:08:28
另一个答案中的示例不必要地复杂.如果您要做的只是返回查询或集合中每个文档的原始数据对象,这将更简单:
The example in the other answer is unnecessarily complex. This would be more straightforward, if all you want to do is return the raw data objects for each document in a query or collection:
async getMarker() {
const snapshot = await firebase.firestore().collection('events').get()
return snapshot.docs.map(doc => doc.data());
}