Hi,
i’m studying and still discovering mongodb but it’s starting bad.
i have no problem to connect directly with compass but now i’m trying to connect and add data using python and it’s just giving me Timeout error.
i looked in other topics to solve the problem but nothing worked ( double clic on ‘Install Certificates.command’ too but nothing changed)
when i used an other mac everything worked well, the problem is just with mine.
so i’m using macOs if it matters and this is my code:
import datetime
from pymongo import MongoClient
client = MongoClient('mongodb+srv://hduser:********@cluster0.pvpgbwp.mongodb.net/test', 27017 )
coll = client.db.posts_dbo
doc = {"auteur":"Flouflou",
"texte":"Mon premier post du mois",
"tags":["python","mongodb"],
"date":datetime.datetime.utcnow()
}
post_id = coll.insert_one(doc).inserted_id
print(post_id)