0 points

Get Firestore Data (Documents)


dashboard

Sat Nov 21 2020 22:19:05 GMT+0000 (UTC)

Posted by @narro #javascript

const collectionName = 'databases' // this is my collection name
const ref = firebase.firestore().collection(collectionName);
ref.onSnapshot((snapshot) => {
  snapshot.forEach((doc) => {
    const data = doc.data();
    // ...
  });
});
content_copy Copy

Get Database/Collection Info from Firestore Found by right-clicking on a collection name in the Firebase VS Code Extension in the Firestore section.