title: How to mongoimport from any location in cmd
body: <p>So right now I'm using mongoose to work with MongoDB (learning). Something I tried to do was import a JSON array by using</p>
  <p><code>mongoimport --db mongo-testing --collection test  --drop --file data.json --jsonArray</code></p>
  <p>but it didn't work giving an error that <code>mongoimport</code> was not found. After looking around in StackOverflow, I found that you needed to run the command in the \bin\ folder where your mongo PATH variable points to. So I did just that.</p>
  <p><code>mongoimport --db mongo-testing --collection test  --drop --file /d/Node/mongo-test/data.json --jsonArray</code></p>
  <p>The command above I ran in the <code>\bin\</code> folder and pointed the file via an absolute path and it worked! However, I don't think that's the right way to do it.</p>
  <p>Question: Is there a way I could run the command in <code>/d/Node/mongo-test/</code> file where my Node.js project is or do I need to go to the bin folder each time</p>
  <p><strong>bin folder for mongo</strong></p>
  <p><a href="https://i.stack.imgur.com/6NHAF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6NHAF.png" alt="enter image description here" /></a></p>