📜  使用异步等待从 Firestore 获取数据 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:08.059000             🧑  作者: Mango

代码示例1
const logCities = async () => {
  let citiesRef = db.collection('cities');
  let allCities = await citiesRef.get();
  for(const doc of allCities.docs){
    console.log(doc.id, '=>', doc.data());
  }
}