-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime Firestore query results in error for "docChanges" #824
Comments
@Thkasis Sorry for the trouble! We changed docChanges into a method in 5.0.0 so you must now do Thanks and sorry! |
@mikelehen, not a problem, thanks for the update. It would definitely be helpful to have this in the documentation instead if it's supposed to be the standard from now on as documentation still shows docChanges.forEach() Thanks for all the good work. |
Thank you! I see that indeed https://firebase.google.com/docs/firestore/query-data/listen still has the old syntax. Whoops! We'll get that updated shortly. Thanks for mentioning it. |
@Thkasis updating the docs right now, thanks! |
@mikelehen |
@mohshraim yep we will add this to the docs soon, sorry about the delay! |
@google-cloud/firestore 0.16.1 has the opposite problem - snapshot.docChanges() errors with docChanges is not a function so I'm using snapshot.docChanges instead! |
PR for @google-cloud/firestore pending: googleapis/nodejs-firestore#324 This will make docChanges() a method in all of our JavaScript-based SDKs. |
it seems they came back to a property , for me just works like docChanges, without parenthesis |
@elchefuser It should still be a method. Which npm module are you using and what version? |
[REQUIRED] Describe your environment
Simple query for realtime onSnapshot() results in error when trying to work with snapshot.docChanges.
I don't see any doc.docChanges defined as it was in the previous version (4.9.1) that I was using and I get this error:
snapshot.docChanges.forEach is not a function. Logging snapshot.docChanges is not an array of changes as it was before and instead shows the prototype method.
Steps to reproduce:
Simply query data either using get() or realtime onSnapshot() similar to Firestore documents.
For realtime query:
when I log snapshot.docChanges I see this instead of the array of results :
ƒ (e){validateOptionNames("QuerySnapshot.docChanges",e,["includeMetadataChanges"]),e&&validateNamedOptionalType("QuerySnapshot.docChanges","boolean","includeMetadataChanges",e.includeMetadataChanges);v…
The text was updated successfully, but these errors were encountered: