1

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...
wpfwannabe
  • 14,587
  • 16
  • 78
  • 129
  • Possible duplicate of [mongodb how to migrate only indexes to another mongodb instance](http://stackoverflow.com/questions/26458457/mongodb-how-to-migrate-only-indexes-to-another-mongodb-instance) – Wander Nauta Feb 03 '17 at 15:35

0 Answers0