MongoDB Python Driver

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any MongoDB Question?