Mongorestore to a different database
<p>In MongoDB, is it possible to dump a database and restore the content to a different database? For example like this:</p>
<pre><code>mongodump --db db1 --out dumpdir
mongorestore --db db2 --dir dumpdir
</code></pre>
<p>But it doesn't work. Here's the error message:</p>
<blockquote>
<p>building a list of collections to restore from dumpdir dir</p>
<p>don't know what to do with subdirectory &quot;dumpdir/db1&quot;, skipping...</p>
<p>done</p>
</blockquote>