(base) [root@rudonx ~]# python
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type help , copyright , credits or license for more information.
>>> import pymongo
>>> pymongo.version
'3.12.0'
3.2 使用驱动连接MongoDB
在Python 交互模式下运行如下代码查看client相关信息
from pymongo import MongoClient
uri = mongodb://root:xxxxxx@mongodb-endpoint
client = MongoClient(uri)
print(client)