Numeric Collection Name Remove

Petrogad picture Petrogad · Mar 20, 2012 · Viewed 23.4k times · Source

How can you drop a numeric collection from MongoDB?

PRIMARY> db.123456789011.remove({});
Tue Mar 20 08:42:51 SyntaxError: missing ; before statement (shell):1

PRIMARY> db.123456789011.drop({});
Tue Mar 20 08:43:13 SyntaxError: missing ; before statement (shell):1

Was created through a PHP script.. now I can't figure out how to remove this..

Thoughts?

Thank you

Answer

dampier picture dampier · Mar 20, 2012

This should work:

   db["123456789011"].drop()