Docs Home / Compass / Connect

Disconnect from MongoDB断开与MongoDB的连接

Disconnecting from a MongoDB deployment closes the Compass connection to the active deployment and returns the Compass view to the initial connection dialog. When you disconnect, Compass safely ends your session with the database server. This process ensures that any open transactions are closed and resources are freed on both the client and server sides.断开与MongoDB部署的连接会关闭与活动部署的Compass连接,并将Compass视图返回到初始连接对话框。断开连接后,Compass会安全地结束与数据库服务器的会话。此过程可确保关闭任何打开的事务,并释放客户端和服务器端的资源。

Disconnecting is helpful when you want to switch between different MongoDB deployments, update your connection settings, or end your current session for security reasons. After disconnecting, you can always reconnect to the same deployment or connect to a different one.当您想在不同的MongoDB部署之间切换、更新连接设置或出于安全原因结束当前会话时,断开连接很有帮助。断开连接后,您始终可以重新连接到同一部署或连接到其他部署。

Steps步骤

1

Click Connect in the menu bar.单击菜单栏中的“连接”。

2

Select Disconnect from the dropdown menu.从下拉菜单中选择“断开连接”。

Learn more了解更多

To create a new connection, see Connect Compass to MongoDB.要创建新连接,请参阅将Compass连接到MongoDB