I have this code, which returns the parents of a certain doc.
console.log(doc.ref.parent.get())
I use collectionGroup to search if there is user wit email which is same as the email of the user who is logged to the app.
var nameRef = db
.collectionGroup('Users')
.where('email', '==', currentUser.email)
useEffect(() => {
nameRef.get().then((snapshot) => {
snapshot.docs.forEach((doc) => {
console.log(doc.ref.parent.get())
})
})
}, [])
It returns a promise:
How to Access the segments Array in the Path in the qf in PromiseResult. I tried some object restructuring but it did not work.