공부/python
-
python & mongoDB 연동공부/python 2023. 1. 18. 20:51
from pymongo import MongoClient connection = MongoClient('localhost', 27017) print(connection) print(connection.list_database_names()) # DB 목록 출력 db = connection.Test # DB 생성 print(db) collection = db.AAA # collection 생성 print(collection) ## insert_one data = {"name": "user01", "wall_post": "laugh out loud. LOL XD", "follow": 34 } col = db.collection result = col.insert_one(data) print(result) #..