Reputation: 233
I have an error on firestore, my guess is that the tutorial i read has older version than mine. My question is, what would be the correct code in the version 5.5.6?
I highlighted the problem.
Upvotes: 2
Views: 2141
Reputation: 292
docChanges
is a method (See here) .
so your code should be like:
(querySnapshot.docChanges())[0].doc.data().userId ? true : false
haven't tested yet, though it should work if the document is correct.
See also:
https://firebase.google.com/docs/reference/js/firebase.firestore.DocumentChange
https://firebase.google.com/docs/reference/js/firebase.firestore.QueryDocumentSnapshot
Upvotes: 1