Search code examples
mongodbjruby

How to remove a mongo collection name with a special character �?


Accidentally created a collection with "�" in its name. Now i'm looking for a way to delete it.

P.s. I tried db['�'].drop() and that did not work out for me.


Solution

  • Figured it out myself. db['\ufffd'].drop() worked for me. Converting "�" to unicode solved the problem. Hope someone finds it useful. This should work for other special characters as well.