async function getDocument()

in firestore/main/index.js [508:518]


async function getDocument(db) {
  // [START firestore_data_get_as_map]
  const cityRef = db.collection('cities').doc('SF');
  const doc = await cityRef.get();
  if (!doc.exists) {
    console.log('No such document!');
  } else {
    console.log('Document data:', doc.data());
  }
  // [END firestore_data_get_as_map]
}