MongoDB: Deleting Collection with a space in the name

Run across this interesting problem few days ago — a collection was created with a space in it’s name. Can’t deleted with your regular db.COLLECTION.drop(); The workaround is simple and straightforward though:

db["COLLECTION NAME"].drop();

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>