Forgot to change the tips script to mongo
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
import firebase_admin
|
||||
from dotenv import load_dotenv
|
||||
from firebase_admin import credentials, firestore
|
||||
|
||||
from pymongo import MongoClient
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# staging: encoach-staging.json
|
||||
# prod: storied-phalanx-349916.json
|
||||
|
||||
cred = credentials.Certificate('../../../firebase-configs/encoach-staging.json')
|
||||
firebase_admin.initialize_app(cred)
|
||||
|
||||
mongo_db = MongoClient(os.getenv('MONGODB_URI'))[os.getenv('MONGODB_DB')]
|
||||
|
||||
if __name__ == "__main__":
|
||||
db = firestore.client()
|
||||
with open('pathways_2_rw.json', 'r', encoding='utf-8') as file:
|
||||
book = json.load(file)
|
||||
|
||||
@@ -33,5 +31,4 @@ if __name__ == "__main__":
|
||||
tips.append(new_tip)
|
||||
|
||||
for tip in tips:
|
||||
doc_ref = db.collection("walkthrough").document(tip["id"])
|
||||
doc_ref.set(tip)
|
||||
doc_ref = mongo_db.walkthrough.insert_one(tip)
|
||||
|
||||
Reference in New Issue
Block a user