from pymongo import MongoClient
import certifi
ca = certifi.where()
client = MongoClient('mongodb+srv://test:sparta@cluster0.hlswz.mongodb.net/Cluster0?retryWrites=true&w=majority',tlsCAFile=ca)
db = client.dbsparta
doc = {'name':'bobby','age':21}
db.users.insert_one(doc)
user = db.users.find_one({'name':'bobby'})
all_users = list(db.users.find({},{'_id':False}))
db.users.update_one({'name':'bobby'},{'$set':{'age':19}})
db.users.delete_one({'name':'bobby'})