from pymongo import MongoClient
cluster = MongoClient("mongodb+srv://qu3ry:mypassword@cluster0.gtujige.mongodb.net/?retryWrites=true&w=majority")
collection = cluster.testdatabase.users
pattern = {
"_id": 1,
"name": "Sasa",
"items": {
"apple": 3,
"banana": 2
}
}
collection.insert_one(pattern)