Last active
September 14, 2022 06:50
-
-
Save danieldanciu/fe6729767a681b6818710911b69153e0 to your computer and use it in GitHub Desktop.
How the callback is registered
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logging.info(f'Watching Firestore collection {firestore_prefix}users/<user_id>/jobs ' | |
f'for documents with status=={statuses_of_interest}') | |
sync_client = firestore.Client(credentials=creds, project=project_id) | |
# a Firebase index on collection_id and field status MUST exist for this query to work | |
watched_jobs = sync_client.collection_group(job_collection_id).where('status', 'in', statuses_of_interest) | |
... | |
watched_jobs.on_snapshot(callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment