Docs HomeMongoDB Compass

Advanced Connection Tab“高级连接”选项卡

On this page本页内容

The Advanced connection tab provides additional connection options for your deployment. “高级连接”选项卡为您的部署提供了其他连接选项。These options can be used with the General, Authentication, TLS / SSL, and Proxy / SSH Tunnel connection options.这些选项可以与常规身份验证TLS / SSL代理/SSH隧道连接选项一起使用。

Procedure过程

1

Click Advanced Connection Options.单击“高级连接选项”。

New Advanced Connection Options
2

Click the Advanced tab.单击“高级”选项卡。

(Optional) Select a Read Preference from the following options:(可选)从以下选项中选择“读取首选项”:

Read Preference读取首选项Description描述
PrimaryDefault mode. 默认模式。All operations read from the current replica set primary. 从当前复制副本集主副本读取的所有操作。If the primary is unavailable, the operation fails.如果主服务器不可用,则操作失败。
Primary PreferredOperations read from the primary unless the primary is unavailable. 从主服务器读取操作,除非主服务器不可用。If the primary is unavailable, operations read from secondary members.如果主成员不可用,则从辅助成员读取操作。
SecondaryAll operations read from the secondary members of the replica set. 从复制副本集的辅助成员读取的所有操作。If the secondary is unavailable, the operation fails.如果辅助不可用,则操作失败。
Secondary PreferredOperations read from the secondary unless the secondary is unavailable. 从辅助设备读取的操作,除非辅助设备不可用。If the secondary is unavailable, operations read from the primary on sharded clusters.如果辅助集群不可用,则在分片集群上从主集群读取操作。
NearestOperations read from a random eligible replica set member, irrespective of whether that member is a primary or secondary, based on a specified latency threshold. 根据指定的延迟阈值,从符合条件的随机副本集成员读取操作,而不管该成员是主成员还是辅助成员。The operation considers the following when calculating latency:在计算延迟时,操作会考虑以下因素:

Additional Optional Fields其他可选字段

Field字段Description描述
Replica Set Name副本集名称(Optional) Name of replica set.(可选)复制副本集的名称。
Default Authentication Database默认身份验证数据库(Optional) Authentication database used when authSource is not specified. (可选)未指定authSource时使用的身份验证数据库。For more information, see Authentication Options.有关详细信息,请参阅身份验证选项
URI OptionsURI选项Additional options to customize your connection. 自定义连接的其他选项。You specify these options as key-value pairs, and Compass automatically adds the key-value pairs to the connection string. 将这些选项指定为键值对,Compass会自动将键值对添加到连接字符串中。For more information, see Connection String Options.有关详细信息,请参阅连接字符串选项
3

Click Connect.单击“连接”。

Tip

See also:

To disconnect from your deployment, see Disconnect from MongoDB.要断开与部署的连接,请参阅断开与MongoDB的连接