与python交互 点击查看官方文档(http://api.mongodb.com/python/current/tutorial.html) 安装python包
sudo pip3 install pymongo
第一步的两种连接方式: The above code will connect on the default host and port. We can also specify the host and port explicitly, as follows:
client = MongoClient('localhost', 27017)
Or use the MongoDB URI format:
client = MongoClient('mongodb://localhost:27017/')
更多使用详情可以查看mongo的官方文档使用方法:官方文档(http://api.mongodb.com/python/current/tutorial.html)