title: how to restore a collection or collections in mongodb from an archive file?
body: <p>I have created a dump in an archive file by the following command :</p>
  
  <pre><code>mongodump --archive=newcollection.1.archive --db neel --collection newcollection
  </code></pre>
  
  <p>While restoring with the mongorestore i am getting an error :<strong>the --db and --collection args should only be used when restoring from a BSON file.</strong></p>
  
  <p>I got the syntax from [<a href="https://docs.mongodb.com/manual/reference/program/mongorestore/#examples][1]" rel="noreferrer">https://docs.mongodb.com/manual/reference/program/mongorestore/#examples][1]</a> .</p>
  
  <p>I fired the following command :</p>
  
  <pre><code>mongorestore --archive=newcollection.1.archive  --db backup2.
  </code></pre>