Docs HomeMongoDB Compass

Block Outgoing Network Connections阻止传出网络连接

You can configure MongoDB Compass to not perform outgoing network operations other than those to the database. 您可以将MongoDB Compass配置为不执行对数据库以外的传出网络操作。This lets you configure any edition of Compass to restrict outgoing connections in the same way Compass Isolated Edition restricts connections.这使您可以将任何版本的Compass配置为限制传出连接,就像Compass独立版限制连接一样。

Warning

When you block outgoing network connections, Compass can't use third-party mapping services in schema visualizations.当您阻止传出网络连接时,Compass无法在架构可视化中使用第三方映射服务。

Procedure过程

To block outgoing network operations, disable the networkTraffic configuration option. 要阻止传出网络操作,请禁用networkTraffic配置选项。You can set configuration options in either a command line option or configuration file option.您可以在命令行选项或配置文件选项中设置配置选项。

Command Line Example命令行示例

The following command starts MongoDB Compass from the command line and sets the --no-networkTraffic option:以下命令从命令行启动MongoDB Compass,并设置--no-networkTraffic选项:

<path-to-Compass-executable> --no-networkTraffic
Note

The name and filepath of the Compass executable depend on your operating system.Compass可执行文件的名称和文件路径取决于您的操作系统。

Configuration File Example配置文件示例

You can specify the Compass configuration file in either EJSON or YAML format. 您可以以EJSON或YAML格式指定Compass配置文件。The following configurations set the networkTraffic option to false:以下配置将networkTraffic选项设置为false

EJSON

{ "networkTraffic": false }

YAML

networkTraffic: false

Learn More了解更多信息

To learn more about the MongoDB Compass configuration file, see Configuration File Settings.要了解有关MongoDB Compass配置文件的更多信息,请参阅配置文件设置