I currently have code that gets back school data from a database and saves it to a csv file:
schoolID = '12345'
def getSchool(schoolID):
School = SchoolsDB.find_one({"_id": ObjectId(schoolID)})
return School
school = getSchool(schoolID)
school.to_csv(schoolID + ".csv")
It currently takes in a schoolID and runs one school at a time. I have tried putting it in a for loop so that it runs one school after another automatically, but I want to be able to run all schools at the same time.
I want to be able to use lambda to run all the schools at the same time, instead of one at a time. Does anyone know how to do this?
schoolIDan array andfind()all of them in one go ?