11 lines
208 B
Python
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)
|