format fields update
This commit is contained in:
@@ -17,7 +17,7 @@ db = firestore.client()
|
||||
patient_collection = db.collection("patientData")
|
||||
test_collection = db.collection("testData")
|
||||
|
||||
query = patient_collection.where(filter=FieldFilter("createdAt", ">=", "2023-11-07")).where(filter=FieldFilter("createdAt", "<", "2023-11-08"))
|
||||
query = patient_collection.where(filter=FieldFilter("createdAt", ">=", "2023-10-10")).where(filter=FieldFilter("createdAt", "<", "2023-10-11"))
|
||||
#.where(filter=FieldFilter("registrationCenterName", "==", "SCS high school"))
|
||||
patient_docs = query.stream()
|
||||
|
||||
@@ -27,16 +27,14 @@ data = []
|
||||
for patient_doc in patient_docs:
|
||||
patient_data = patient_doc.to_dict()
|
||||
data.append(patient_data)
|
||||
# print(patient_data['_idSearch'])
|
||||
# if patient_data['_idSearch'] is None:
|
||||
# # print(patient_doc.id)
|
||||
# print(patient_data['_id'])
|
||||
# print(patient_data['_id'])
|
||||
if "LAL" in patient_data['_id']:
|
||||
if "VIS" in patient_data['_id']:
|
||||
# print("ADA")
|
||||
print(patient_data['_id'])
|
||||
doc_ref = db.collection("patientData").document(patient_doc.id)
|
||||
batch.update(doc_ref, {"_idSearch": '20231108' + patient_data['_id']})
|
||||
batch.update(doc_ref, {
|
||||
"_idSearch": '20231208' + patient_data['_id'],
|
||||
"testStatus": False
|
||||
})
|
||||
|
||||
batch.commit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user