title: MongoDB: Why am I getting "ReferenceError: restaurants_db is not defined"?
body: <p>I'm using MongoDB to store data from an API and whenever I try to add the API data into the database I get "[thread1] ReferenceError: restaurants_db is not defined"</p>
  
  <p>Here's what I input in terminal, using the mongo shell:</p>
  
  <p>use restaurants_db </p>
  
  <pre><code>"Switched to db restaurants_db" 
  </code></pre>
  
  <p>show collections</p>
  
  <pre><code>"restaurants"
  "restaurantsVisited" 
  </code></pre>
  
  <p>restaurants_db &lt; restaurantAPI.js</p>
  
  <pre><code>[thread1] ReferenceError: restaurants_db is not defined
  </code></pre>
  
  <p>Any idea what's wrong and how I can fix it?</p>
  
  <p>Here's my API:</p>
  
  <pre><code>use restaurants_db;
  
  db.restaurants.insert([
  {
  name: "Amarone",
  coords: [55.9537467, -3.1944039],
  },
  {
  name: "McDonalds",
  coords: [55.9538144,-3.1928817],
  },
  {
  name: "Pizza Hut"
  coords: [55.9535647,-3.1978135],
  },
  
  ]);
  </code></pre>