MongoDBPython Driver


Syntax

  • mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

Parameters

ParameterDetail
hostXOptional. You can specify as many hosts as necessary. You would specify multiple hosts, for example, for connections to replica sets.
:portXOptional. The default value is :27017 if not specified.
databaseOptional. The name of the database to authenticate if the connection string includes authentication credentialsIf /database is not specified and the connection string includes credentials, the driver will authenticate to the admin database.
?optionsConnection specific options