I have an existing database with collection, indexes and data. I now want to deploy database to another location without any data (just collection and indexes). I fail to find a simple way to recreate basic database structure w/o data.
Is there a command/tool that exports an existing database/collection as a series of JavaScript commands such as below? I can't seem to find anything related to this. I am currently using Robomongo as a management/test/query tool.
db.createCollection('test');
db.test.createIndex('index', ...);
// etc...