Python Connector for MongoDB

Connection parameters - Python Connector for MongoDB

Connection parameters

The following table describes the MongoDB connection parameters you can use in the connect() module method.

Parameter Description

Server

The server name or IP address

Database

The name of the database

Port

The port number. The default value is 27017.

UserName

The name of the database user

Password

The password of the database user

ClientLibrary

The path to the libmongoc client library. For more information, see the MongoDB documentation.

BSONLibrary

The path to the libbson client library. For more information, see the MongoDB documentation.

PoolId

The ID of a connection pool that will be used for a particular connection

DisablePooling

Disables connection pooling for a particular connection.

The possible values are True and False. The default value is False.

ComplexAsString

Specifies the mapping of complex fields (object, array, timestamp, binary, regular expression, and JavaScript types). The possible values are:

  • False – (Default) Complex fields are represented as a set of their child fields.
  • True – Complex fields are mapped to a single string field and their values are displayed in the Extended JSON format.

DescribeAmount

The number of documents in a collection that will used to create a list of fields in a dataset. The default value is 25.

AdditionalServers

Additional hosts in the host[:port] format, separated by commas

ConnectionOptions

Additional connection string options. For more information, see the MongoDB documentation.

© 2022-2025 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback