简体   繁体   English

Robo 3T 以编程方式连接到数据库并删除数据库

[英]Robo 3T connect to a database and dropDatabases programatically

I have multiple databases on mongo, let's say mydb , mydb1 , mydb2 , mydb3 , mydb4 .我在 mongo 上有多个数据库,比如说mydbmydb1mydb2mydb3mydb4

Sometimes I want to drop all these databases except mydb .有时我想删除除mydb之外的所有这些数据库。 It is a process that I do manually, right click in the mouse -> Drop Database .这是我手动执行的过程,右键单击鼠标 -> Drop Database

I am looking for commands that I can execute to change the database in Robo 3T, where I am connected to and be able to drop the database, without using the mouse, or query the database.我正在寻找可以执行的命令来更改 Robo 3T 中的数据库,我已连接到该数据库并能够删除数据库,而无需使用鼠标或查询数据库。

Is this possible?这可能吗?

From mongo shell you could run从 mongo shell 你可以运行

db.getSiblingDB("database name").dropDatabase()

Not sure of that will run in Robo3T不确定是否会在 Robo3T 中运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM