1

I somehow ended up with a database named "*" on my mongo server. I want to get rid of it, but I can't find a way to drop it. Trying to execute the normal dropDatabase() functions don't work because the shell won't let me select it (i.e. I run "use *").

How can I drop this database? I tried things like db.getSiblingDB("*").dropDatabase();

Any ideas?

0

2 Answers 2

1

I can drop it.

MongoDB shell version: 2.2.0
connecting to: test
> use *
switched to db *
> db.test.insert({'t':1})    
> show tables    
system.indexes    
test
> show dbs;
*       0.203125GB
admin   0.203125GB
local   (empty)
> use *
switched to db *
> db.dropDatabase()
{ "dropped" : "*", "ok" : 1 }
> show dbs;
admin   0.203125GB
local   (empty)
Sign up to request clarification or add additional context in comments.

Comments

0

What I had succeed switch to the database whose name contains "invalid" letters is to open the CMD in Windows and redirect to the mongodb /bin folder, and then open "mongo.exe" using command line with the database name u wanna switch to as the parameter. So here we go!


EX: Open database named "Congrès"

c:\Program Files\mongodb\bin>mongo.exe Congrès

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.