Docs HomeMongoDB Compass

Favorite Connections收藏夹连接

Compass allows you to save MongoDB connection configurations to easily reconnect to the same MongoDB deployment using the same specifications.Compass允许您保存MongoDB连接配置,以便使用相同的规范轻松地重新连接到相同的MongoDB部署。

Save a Favorite Connection保存收藏夹连接

You can save a favorite connection from the initial connect screen, or after you have successfully connected to a MongoDB deployment.您可以从初始连接屏幕保存喜爱的连接,或者在成功连接到MongoDB部署之后保存。

Save from Connect Screen从连接屏幕保存

1

Configure your connection form with a connection you would like to save.使用要保存的连接配置连接表单。

2

Click Favorite at the top of the form.单击表单顶部的“收藏夹”。

3

Enter a name for this favorite connection.输入此常用连接的名称。

4

(Optional) Select a color for your favorite to more easily identify the favorite connection.(可选)为收藏夹选择一种颜色,以便更容易地识别收藏夹连接。

5

Click Favorite at the top of the form.单击表单顶部的“收藏夹”。

Save after Connecting to a Deployment连接到展开后保存

1

Click Favorite on the left navigation panel.单击左侧导航面板上的“收藏夹”。

2

Enter a name for this favorite connection.输入此常用连接的名称。

3

(Optional) Select a color for your favorite to more easily identify the favorite connection.(可选)为收藏夹选择一种颜色,以便更容易地识别收藏夹连接。

4

Click Favorite on the left navigation panel.单击左侧导航面板上的“收藏夹”。

Edit a Favorite Connection编辑收藏夹连接

1

Click the desired connection under Favorites in the left navigation panel.单击左侧导航面板中“收藏夹”下的所需连接。

To Copy connection string, Duplicate, or Remove a Favorite Connection, hover over the target connection and click the button.要“复制连接字符串”、“复制”或“删除”常用连接,请将鼠标悬停在目标连接上,然后单击按钮。

  • Copying a connection string saves the connection string to your clipboard.复制连接字符串会将连接字符串保存到剪贴板。
  • Duplicating a connection creates another Favorite Connection with the same configuration.复制一个连接会创建另一个具有相同配置的“收藏夹连接”。
  • Removing a connection deletes that Favorite Connection.删除连接会删除该收藏夹连接。
2

Make the desired changes to the connection configuration within the form.对表单中的连接配置进行所需的更改。

When you make any change to a connection, a dialog will appear at the bottom of the form with options Discard and Save Changes.当您对连接进行任何更改时,表单底部将显示一个对话框,其中包含“放弃”和“保存更改”选项。

3

Click Save Changes.单击“保存更改”。

Delete a Favorite Connection删除收藏夹连接

1

Click the desired connection under Favorites in the left navigation panel.单击左侧导航面板中“收藏夹”下的所需连接。

2

Click the button on the connection.单击连接上的按钮。

Compass displays a dropdown menu with options Copy and Remove.Compass显示一个下拉菜单,其中包含“复制”和“删除”选项。

3

Click Remove from the dropdown menu.从下拉菜单中单击“删除”。

Compass removes the connection from the Favorites list and returns the New Connection form to the default state.Compass从“收藏夹”列表中删除连接,并将“新建连接”窗体返回到默认状态。

Considerations注意事项

  • On macOS systems, the first time that you update MongoDB Compass to version 1.20 or later, you will need to allow access to your system storage for each saved connection in Recents and Favorites. 在macOS系统上,第一次将MongoDB Compass更新到1.20或更高版本时,您需要允许访问“最近”和“收藏夹”中每个保存的连接的系统存储。To learn more, see Allow Keychain Access for Recent and Favorite Connections.若要了解更多信息,请参阅允许对最近的连接和收藏夹连接进行钥匙链访问
  • If you run MongoDB Compass on KDE Linux, you must have GNOME Keyring installed to successfully load saved connections. 如果您在KDE Linux上运行MongoDB Compass,则必须安装GNOME Keyring才能成功加载保存的连接。The Electron module Keytar uses GNOME Keyring to securely store the database credentials for your connections.Electron模块Keytar使用GNOME Keyring安全地存储连接的数据库凭据。