I have a mongodb instance with a lot of data, now I need to start up a new instance with the same structure without data.
how to get it done?
I have a mongodb instance with a lot of data, now I need to start up a new instance with the same structure without data.
how to get it done?
You can do that with the "query" option, with a query that does not return any document. Something like:
mongodump -q '{ "foo" : "bar" }'
This will dump all the dbs and indexes, you can then do a mongorestore to recreate them into another mongod instance
See documentation: http://docs.mongodb.org/manual/reference/program/mongodump/#cmdoption--query