changed database to file from pymongo