websucker-pip/mongo/mongoindexer.py
2023-03-05 15:44:49 +01:00

11 lines
208 B
Python

import pymongo
myclient = pymongo.MongoClient("mongodb://root:example@localhost:27017/")
mydb = myclient["mydatabase"]
mycol = mydb["customers"]
mydict = {"text":"ahoj svet"}
x = mycol.insert_one(mydict)