在pymongo 2.x版本中连接有'
MongoClient', '
MongoReplicaSetClient','
Connection'三种方式,其中'
Connection'不建议使用。
在pymongo 3.x版本中
已经没有了'Connection','MongoClient'是在pymongo中连接mongodb服务器的基础类。
'MongoReplicaSetClient'继承了 'MongoClient',其主要功能都差不多,可能在未来的版本中删除
'''
Client for a MongoDB instance, a replica set, or a set of mongoses.
The client object is thread-safe and has connection-pooling built in.
If an operation fails because of a network error,
:class:`~pymongo.errors.ConnectionFailure` is raised and the client
reconnects in the background. Application code should handle this
exception (recognizing that the operation failed) and then continue to
execute.
'''
'MongoReplicaSetClient'继承了 'MongoClient',其主要功能都差不多,可能在未来的版本中删除
'''
:class:`~pymongo.mongo_replica_set_client.MongoReplicaSetClient`
will be removed in a future version of PyMongo.
'''