Inherits object.
Connect to MongoDB, and close when finished.
◆ __init__()
def seims.preprocess.db_mongodb.ConnectMongoDB.__init__ |
( |
|
self, |
|
|
|
ip, |
|
|
|
port, |
|
|
|
maxPoolSize = None |
|
) |
| |
initial mongodb client by hostname and port.
Starting with version 3.0 the MongoClient constructor no longer blocks while connecting to
the server or servers, and it no longer raises ConnectionFailure if they are unavailable,
nor ConfigurationError if the user's credentials are wrong.
Instead, the constructor returns immediately and launches the connection process on
background threads.
--https://api.mongodb.com/python/current/api/pymongo/mongo_client.html
◆ close()
def seims.preprocess.db_mongodb.ConnectMongoDB.close |
( |
|
self | ) |
|
Close collection.
Create this client once for each process, and reuse it for all operations.
It is a common mistake to create a new client for each request, which is very inefficient.
--https://stackoverflow.com/questions/41015490/how-can-i-force-pymongo-to-close-sockets
So, for now, I will comment the close operation. By lj.
◆ get_conn()
def seims.preprocess.db_mongodb.ConnectMongoDB.get_conn |
( |
|
self | ) |
|
The documentation for this class was generated from the following file:
- seims/preprocess/db_mongodb.py