This repository was archived by the owner on Mar 2, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
google/cloud/firestore_v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -459,7 +459,8 @@ def on_snapshot(self, callback):
459459 provided callback is run on the snapshot of the documents.
460460
461461 Args:
462- callback (Callable[[:class:`~google.cloud.firestore.collection.CollectionSnapshot`], NoneType]):
462+ callback (Callable[List[:class:`~google.cloud.firestore_v1.collection.CollectionSnapshot`], \
463+ List[:class:`~google.cloud.firestore_v1.watch.DocumentChange`], datetime.datetime], NoneType):
463464 a callback to run when a change occurs.
464465
465466 Example:
@@ -468,8 +469,8 @@ def on_snapshot(self, callback):
468469 db = firestore_v1.Client()
469470 collection_ref = db.collection(u'users')
470471
471- def on_snapshot(collection_snapshot , changes, read_time):
472- for doc in collection_snapshot.documents :
472+ def on_snapshot(docs , changes, read_time):
473+ for doc in docs :
473474 print(u'{} => {}'.format(doc.id, doc.to_dict()))
474475
475476 # Watch this collection
Original file line number Diff line number Diff line change @@ -500,7 +500,8 @@ def on_snapshot(self, callback):
500500 provided callback is run on the snapshot.
501501
502502 Args:
503- callback(Callable[[:class:`~google.cloud.firestore.document.DocumentSnapshot`], NoneType]):
503+ callback (Callable[List[:class:`~google.cloud.firestore_v1.document.DocumentSnapshot`], \
504+ List[:class:`~google.cloud.firestore_v1.watch.DocumentChange`], datetime.datetime], NoneType):
504505 a callback to run when a change occurs
505506
506507 Example:
@@ -512,9 +513,9 @@ def on_snapshot(self, callback):
512513 db = firestore_v1.Client()
513514 collection_ref = db.collection(u'users')
514515
515- def on_snapshot(document_snapshot , changes, read_time):
516- doc = document_snapshot
517- print(u'{} => {}'.format(doc.id, doc.to_dict()))
516+ def on_snapshot(docs , changes, read_time):
517+ for doc in docs:
518+ print(u'{} => {}'.format(doc.id, doc.to_dict()))
518519
519520 doc_ref = db.collection(u'users').document(
520521 u'alovelace' + unique_resource_id())
Original file line number Diff line number Diff line change @@ -878,7 +878,8 @@ def on_snapshot(self, callback):
878878 provided callback is run on the snapshot of the documents.
879879
880880 Args:
881- callback(Callable[[:class:`~google.cloud.firestore.query.QuerySnapshot`], NoneType]):
881+ callback (Callable[List[:class:`~google.cloud.firestore_v1.query.QuerySnapshot`], \
882+ List[:class:`~google.cloud.firestore_v1.watch.DocumentChange`], datetime.datetime], NoneType):
882883 a callback to run when a change occurs.
883884
884885 Example:
You can’t perform that action at this time.
0 commit comments