Is there a dead easy way to rename a collection in mongo? Something like:
db.originalCollectionName.rename(\'newCollectionName\');
And if
For those who cannot rename, because the name causes an issue like: SyntaxError: Unexpected token ILLEGAL, it is because the name is illegal.
You can work around this by calling with brackets notation: db["oldCollectionILLEGALName"].renameCollection("someBetterName")
db["oldCollectionILLEGALName"].renameCollection("someBetterName")