-
Notifications
You must be signed in to change notification settings - Fork 0
doc(firestore): change on_snapshot document #1
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
base: master
Are you sure you want to change the base?
Conversation
| Args: | ||
| callback(Callable[[:class:`~google.cloud.firestore.document.DocumentSnapshot`], NoneType]): | ||
| callback(Callable[List[:class:`~google.cloud.firestore_v1.document.DocumentSnapshot`], \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space should be added after first callback word
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should i add the space, because i didn't change that thing, i have only added that parameters
| def on_snapshot(document_snapshot, changes, read_time): | ||
| doc = document_snapshot | ||
| print(u'{} => {}'.format(doc.id, doc.to_dict())) | ||
| for doc in collection_snapshot.documents: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
google/cloud/firestore_v1/query.py
Outdated
| Args: | ||
| callback(Callable[[:class:`~google.cloud.firestore.query.QuerySnapshot`], NoneType]): | ||
| callback(Callable[List[:class:`~google.cloud.firestore_v1.query.QuerySnapshot`], \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after callback should be added
| def on_snapshot(collection_snapshot, changes, read_time): | ||
| for doc in collection_snapshot.documents: | ||
| for doc in collection_snapshot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In here you're deleting documents, but in the next file you're keeping it, though examples looks the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This given example is not working , if i remove .documents then it works properly as it gives document_snapshot in return, so once i confirm it,i will changed it.
| def on_snapshot(document_snapshot, changes, read_time): | ||
| doc = document_snapshot | ||
| print(u'{} => {}'.format(doc.id, doc.to_dict())) | ||
| for doc in document_snapshot: | ||
| print(u'{} => {}'.format(doc.id, doc.to_dict())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make it consistent with the changes to the collection.py:
def on_snapshot(docs, changes, read_time):
for doc in docs:
print(u'{} => {}'.format(doc.id, doc.to_dict()))
...or vice versa.
… into firestore_issue_26
… into firestore_issue_26
… into firestore_issue_26

Fixes [26]