Category : google-cloud-firestore

I have 2 maps called favorite and recommend. Basically, both favorite and recommend contain a map movie_ID: rating. Here is how i want it. Here is my code to do that: def writeFavorite(dta, uid): user = db.collection(‘user’).document(uid) for i in dta: row = { ‘favorite’: {i[‘movie_id’]: i[‘rating’]} } user.set(row, merge=True) def writeRecommend(dta, uid): user = ..

Read more

I’m running python 3.9 with all firebase-admin and firestore modules installed. When trying to run my code importing firestore its giving an error. I have tried the same on my Mac and it works perfectly fine. This is the error: Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/firebase_admin/firestore.py", line 22, in <module> from google.cloud import firestore ..

Read more

I’m using google.cloud.firestore with Async Client, and I want to add timeout setting for adding documents but I can’t somehow… Versions Python: 3.9.7 google-cloud-firestore: ">=2.1.0" API framework: fastapi: "^0.70.0" pytest: "^6.2.5" pytest-asyncio: "^0.16.0" Problem When I run this code without setting firebase server turning on: from firebase_admin import firestore db_client = firestore.AsyncClient() async def some_function(): ..

Read more

Im currently having issues importing modules in my venv on vscode for google cloud firestore. import firebase_admin from firebase_admin import credentials from firebase_admin import firestore pip -V shows python 3.8. python -V shows Python 3.8.1. using pip freeze, the module appears here. firebase-admin==5.0.3 however it returns ModuleNotFoundError: No module named ‘firebase_admin’ ive triedfrom google.cloud import ..

Read more

I have built a container which uses the Cloud Storage and Firestore. I am able to access the storage but not firestore. The service account I am using is a Owner. DockerFile: WORKDIR /usr/src/app COPY packages-file.txt requirements.txt RUN pip3 install -r requirements.txt COPY cred.json cred.json ENV GOOGLE_APPLICATION_CREDENTIALS "/usr/src/app/cred.json" COPY . . CMD ["main.py"] ENTRYPOINT ["python3","main.py"] ..

Read more