title: Check if a document exists in the collection, if not add a new document
body: <p>I'm using MongoDB with PHP to store songs which users add via a basic form. The collection I created looks like below.   </p>
  
  <pre><code>$object = array(
      "trackName" =&gt; "Sju sorger",
      "artistName" =&gt; "Veronica Maggio",
      "albumName" =&gt; "Satan i Gatan",
       );
  $collection-&gt;save($object);
  </code></pre>
  
  <p>What I trying to accomplish is to check if a song is already in the collection. If the song user trying to add is not already in the collection, it'd be added. If it is already in the collection, a notification stating that the song is already in the collection will be displayed.</p>
  
  <p>I'm relatively new to MongoDB but I assume I can check if the song is already in the collection by checking the <strong>_id</strong> of the document. But I have no idea on how to accomplish that.</p>
  
  <p>Any help would be much appreciated.</p>