@@ -28,7 +28,7 @@ class MongoEngineConnectionError(Exception):
2828_dbs = {}
2929
3030
31- def register_connection (alias , name = None , host = None , port = None ,
31+ def register_connection (alias , db = None , name = None , host = None , port = None ,
3232 read_preference = READ_PREFERENCE ,
3333 username = None , password = None ,
3434 authentication_source = None ,
@@ -39,6 +39,7 @@ def register_connection(alias, name=None, host=None, port=None,
3939 :param alias: the name that will be used to refer to this connection
4040 throughout MongoEngine
4141 :param name: the name of the specific database to use
42+ :param db: the name of the database to use, for compatibility with connect
4243 :param host: the host name of the :program:`mongod` instance to connect to
4344 :param port: the port that the :program:`mongod` instance is running on
4445 :param read_preference: The read preference for the collection
@@ -58,7 +59,7 @@ def register_connection(alias, name=None, host=None, port=None,
5859 .. versionchanged:: 0.10.6 - added mongomock support
5960 """
6061 conn_settings = {
61- 'name' : name or 'test' ,
62+ 'name' : name or db or 'test' ,
6263 'host' : host or 'localhost' ,
6364 'port' : port or 27017 ,
6465 'read_preference' : read_preference ,
0 commit comments