Release Notes
Announcements

Parameter | Description | Required or Not | Remarks |
mongodb:// | MongoDB protocol identifier | Yes | - |
username:password | Database authentication information | Yes | Default user: TencentDB for MongoDB has a built-in default user mongouser. Custom user: On the Database Management page in the TencentDB for MongoDB console, you can create users. For detailed operations, see Account Management. |
host:port | Instance node address | Yes | Multiple addresses are supported, separated by commas. |
/admin or authSource=admin | Authentication database | Yes | Users created in the console: The authentication database is uniformly set to admin, and the authSource=admin setting should be specified during connection to the database. Users created using the command line: The authentication database is the database where the user was created. (For example, if the user is created in the test database, the authentication database is the test database.) |
replicaSet | Replica set ID | Yes | Identify the replica set name of the instance. |
authMechanism=SCRAM-SHA-1 | Authentication mechanism | No | Authentication mechanisms: SCRAM-SHA-1 and SCRAM-SHA-256 |
readPreference | Read preference setting | No | Control the routing of read requests. For example: mongodb://.../admin?readPreference=secondaryPreferredprimary: (Default) All read requests are only sent to the primary node. primaryPreferred: Read requests are sent to the primary node first; if the primary node is unavailable, read requests will be routed to secondary or read-only nodes. secondary: Read requests are routed to secondary or read-only nodes. If secondary nodes are unavailable, read requests will return an error. secondaryPreferred: Read requests are sent to secondary or read-only nodes first; if secondary or read-only nodes are unavailable, read requests will be routed to the primary node. |
フィードバック