title: Retrieving Data from Meteor Collections
body: <p>I'm having a few problems when trying to get data from a Meteor Collection and I need some advice.</p>
  
  <p>The collection has been defined, published, and subscribed successfully. If I send the data to a template, it displays fine:</p>
  
  <pre><code>Template.Lists.Projects = function(){
      return Projects.find();
  };
  </code></pre>
  
  <p>But I am trying to use the data before displaying it, and this is where I run into problems. First, I'm getting some inconsistencies between find() and findOne(). find(selector) works fine and returns a cursor, but findOne(selector) returns "undefined." I really am only looking for 1 entry, so find() seems unnecessary.</p>
  
  <p>Returns LocalCollection.Cursor:</p>
  
  <pre><code>var find = Projects.find({_id: "3fd33eed-9735-4376-860e-3be383beae2f"});
  console.log(find);
  </code></pre>
  
  <p>Returns undefined:</p>
  
  <pre><code>var find = Projects.findOne({_id: "3fd33eed-9735-4376-860e-3be383beae2f"});
  console.log(find);
  </code></pre>
  
  <p>My next problem arises when using .fetch() on the LocalCollection.Cursor. It returns an empty array.</p>
  
  <pre><code>var find = Projects.find({_id: "3fd33eed-9735-4376-860e-3be383beae2f"});
  var fetch = find.fetch();
  console.log(fetch);
  </code></pre>
  
  <p>all this returns is the following line:</p>
  
  <p>[ ]</p>
  
  <p>When I try to specify a specific key from the array I want to display, like:</p>
  
  <pre><code>var find = Projects.find({_id: "3fd33eed-9735-4376-860e-3be383beae2f"});
  var fetch = find.fetch();
  console.log(fetch.name);
  </code></pre>
  
  <p>It returns undefined.</p>
  
  <p>I'm still familiarizing myself with Meteor and have never used MongoDB (or minimongo), so I'm probably just making some stupid mistake. If anyone can point it out to me I would be thrilled!</p>