'Mongodb: mongodump collections that their names contain a path separator '/'

I have a database with a lot of collections that have '/' in their names. The problem is mongodump will fail in this circumstance.

Failed: "CollectionNameWith/Sign" contains a path separator '/' and can't be dumped to the filesystem

And if I use mongodump with --archive flag, mongodump cannot export any document or mongorestore cannot work properly. (same problem)

I found the same problem in mongodb jira, there isn't any solution for this problem.

Any comments would be appreciated.


EDIT: See how I solved the issue in my comment!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source