diff --git a/bigchaindb/backend/mongodb/connection.py b/bigchaindb/backend/mongodb/connection.py index a93fb29f..3a967d48 100644 --- a/bigchaindb/backend/mongodb/connection.py +++ b/bigchaindb/backend/mongodb/connection.py @@ -11,19 +11,19 @@ logger = logging.getLogger(__name__) class MongoDBConnection(Connection): - def __init__(self, host=None, port=None, db=None, max_tries=3): + def __init__(self, host=None, port=None, dbname=None, max_tries=3): """Create a new Connection instance. Args: host (str, optional): the host to connect to. port (int, optional): the port to connect to. - db (str, optional): the database to use. + dbname (str, optional): the database to use. max_tries (int, optional): how many tries before giving up. """ self.host = host or bigchaindb.config['database']['host'] self.port = port or bigchaindb.config['database']['port'] - self.db = db or bigchaindb.config['database']['name'] + self.dbname = dbname or bigchaindb.config['database']['name'] self.max_tries = max_tries self.conn = None @@ -33,7 +33,7 @@ class MongoDBConnection(Connection): self._connect() else: - return self.conn[self.db] + return self.conn[self.dbname] def _connect(self): for i in range(self.max_tries):