title: Meteor onRendered function and access to Collections
body: <p>When user refresh a certain page, I want to set some initial values from the mongoDB database. </p>
  
  <p>I tried using the onRendered method, which in the documentation states will run when the template that it is run on is inserted into the DOM. However, the database is not available at that instance?</p>
  
  <p>When I try to access the database from the function: </p>
  
  <pre><code>Template.scienceMC.onRendered(function() {
      var currentRad = radiationCollection.find().fetch()[0].rad;
  }
  </code></pre>
  
  <p>I get the following error messages:</p>
  
  <pre><code>Exception from Tracker afterFlush function:
  TypeError: Cannot read property 'rad' of undefined
  </code></pre>
  
  <p>However, when I run the line <code>radiationCollection.find().fetch()[0].rad;</code> in the console I can access the value?</p>
  
  <p>How can I make sure that the copy of the mongoDB is available?</p>