township-mcp-server / import_to_mongo.py
puseletso55's picture
Update import_to_mongo.py
b7091f8 verified
raw
history blame contribute delete
361 Bytes
import json
from pymongo import MongoClient
client = MongoClient("mongodb+srv://township_chatbot:Daniel%[email protected]/db?retryWrites=true&w=majority&appName=Cluster0")
db = client["township"]
biz = db["businesses"]
with open("seed_data.json") as f:
data = json.load(f)
biz.insert_many(data)
print("Data imported successfully.")