title: How to use `mongorestore` to restore a database using a TAR.GZ file
body: <p>Simple question:</p>
  <pre><code>$ mongorestore --gzip ./Mongo_DB_dump/restore-8f05kcbfhfbce745735eff49.tar.gz
  2020-07-09T18:10:48.207-0500    Failed: file .\Mongo_DB_dump\restore-8f05kcbfhfbce745735eff49.tar.gz does not have .bson extension
  2020-07-09T18:10:48.209-0500    0 document(s) restored successfully. 0 document(s) failed to restore.
  </code></pre>
  <p>How can I restore a database using a ´tar.gz´ file if I don't know the name of the database?
  I'm trying to import a dump from a production instance (MongoDB Cloud) into my local environment. I don't have any previous version of the database in my local if that's relevant.</p>
  <h2>Edit</h2>
  <p>I also tried to use <code>mongostore --gzip</code> using the <em>.tar.gz</em> file and also I tried extracting the contents into a <em>.tar</em> file but, with both files I got the following error:</p>
  <pre><code>2020-07-09T22:33:07.127-0500    Failed: file .\Mongo_DB_dump\restore-8f05kcbfhfbce745735eff49.tar.gz does not have .bson extension
  2020-07-09T22:33:07.128-0500    0 document(s) restored successfully. 0 document(s) failed to restore.
  </code></pre>
  <p>I also tried using <code>/archive:&lt;path-to-file&gt;</code> unsuccessfully:</p>
  <pre><code>$ mongorestore --gzip /archive:./Mongo_DB_dump/restore-8f05kcbfhfbce745735eff49.tar.gz
  2020-07-09T22:52:59.076-0500    Failed: stream or file does not appear to be a mongodump archive
  2020-07-09T22:52:59.077-0500    0 document(s) restored successfully. 0 document(s) failed to restore.
  </code></pre>
  <p>I even attempted to change blindlessly the <code>.tar</code> extension into <code>.bson</code> but that didn't worked out of course:</p>
  <pre><code>2020-07-09T22:08:24.175-0500    checking for collection data in Mongo_DB_dump\restore-8f05kcbfhfbce745735eff49.bson
  2020-07-09T22:08:24.601-0500    restoring Mongo_DB_dump.restore-8f05kcbfhfbce745735eff49 from Mongo_DB_dump\restore-8f05kcbfhfbce745735eff49.bson
  2020-07-09T22:08:24.664-0500    finished restoring Mongo_DB_dump.restore-8f05kcbfhfbce745735eff49 (0 documents, 0 failures)
  2020-07-09T22:08:24.664-0500    Failed: Mongo_DB_dump.restore-8f05kcbfhfbce745735eff49: error restoring from Mongo_DB_dump\restore-8f05kcbfhfbce745735eff49.bson: reading bson input: invalid BSONSize: 1953719666 bytes
  2020-07-09T22:08:24.664-0500    0 document(s) restored successfully. 0 document(s) failed to restore.
  </code></pre>