I am trying to get data from firestore in functions of firebase Node JS 8.
I receive a QueryDocumentSnapshot which is totally fine but i cannot get data from this.
I want androidNotificationToken but i get error undefined.
I am tring this
const missing_owner = snapshot.data().missing_owner;
const found_owner = snapshot.data().found_owner;
console.log("Missing Owner",missing_owner); //this is working
const missRef = admin.firestore().collection(`users`).doc(`${missing_owner}`);
const foundRef = admin.firestore().collection(`users`).doc(`${found_owner}`);
const doc1 = await missRef.get();
const doc2 = await foundRef.get();
console.log("Data is ",doc1); //this is also working
const androidNotificationTokenMisser = doc1.data().androidNotificationToken; //cant get this
const androidNotificationTokenFounder = doc2.data().androidNotificationToken; // and this
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…