Can not delete collection from mongodb

The problem is not with deleting the collection. The problem is with accessing the collection. So you would not be able to update, find or do anything with it from the shell. As it was pointed in mongodb JIRA, this is a bug when a collection has characters like _, - or .

Nevertheless this type of names for collections is acceptable, but it cause a problem in shell.

You can delete it in shell with this command:

db.getCollection("_registration").drop()

or this

db['my-collection'].drop()

but I would rather rename it (of course if it is possible and will not end up with a lot of changing).

Tags:

Mongodb