22 lines
772 B
Python
22 lines
772 B
Python
import firebase_admin
|
|
from firebase_admin import credentials, firestore
|
|
import os
|
|
from google.cloud.firestore_v1.base_query import FieldFilter
|
|
|
|
key_path = os.getcwd() + '/scripts/keys/hpos-preprod-firebase-adminsdk-d6jjt-ae42ad0f67.json'
|
|
cred = credentials.Certificate(key_path)
|
|
firebase_admin.initialize_app(cred)
|
|
def update_incubation(source_collection):
|
|
db = firestore.client()
|
|
|
|
doc_id = "2783399292GMC"
|
|
|
|
try:
|
|
db.collection(source_collection).document(doc_id).update({"incubationTime": "2023-10-09 12:53:00"})
|
|
print(f"Document with ID '{doc_id}' updated")
|
|
except Exception as e:
|
|
print(f"Error deleting document with ID '{doc_id}' from the source collection: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
update_incubation("patientData")
|