如何在本地连接到azure mongo db?

时间:2018-04-26 16:27:31

标签: python-3.x

from pymongo import MongoClient
from datetime import datetime, timedelta,date
import os
# conn = pymongo.MongoClient('://:27017', username='username', password='pass', authSource='admin')
# db = conn.test_database

client = MongoClient(os.getenv("104.211.182.12"))
db = client.test_database   #Select the database
db.authenticate(name=os.getenv("username"),password=os.getenv("password"))

我用实际密码尝试了这个但是没有工作

0 个答案:

没有答案