google-cloud-firestore

Firebase cloud functions using Python?

Firebase cloud functions using Python? Question: We are using GCP’s Firebase with Firestore for a new mobile app we are developing. As part of this effort we need to deploy a number of cloud functions which will act as Firestore triggers for doing some back end processing. Our intention is to keep the deploys encapsulated …

Total answers: 1

How do i download a large collection in Firestore with Python without getting at 503 error?

How do i download a large collection in Firestore with Python without getting at 503 error? Question: Trying to count the number of docs in a firestore collection with python. When i use db.collection(‘xxxx”).stream() i get the following error: 503 The datastore operation timed out, or the data was temporarily unavailable. about half way through. …

Total answers: 3

Get firestore collection size

Get firestore collection size Question: TL;DR Is there an API to get firestore collection size instead of us having to do so manually? So according to their docs, one can calculate the document size by identifying their datatypes. A sample code to illustrate the above is as follows: import datetime def calculate_doc_size(data): if isinstance(data, dict): …

Total answers: 2

Firestore updates using python api are not persisting

Firestore updates using python api are not persisting Question: I have the following code. from firebase_admin import firestore db = firestore.client() collection = db.collection(‘word_lists’) word_list = collection.get() for item in word_list: item_dict = item.to_dict() print item_dict[‘next_practice_date’] item.reference.update({‘next_practice_date’: 0.0}) When I run the code the first time everything is fine, no errors. The second time I …

Total answers: 2