title: filling mongodb with data from service in meteorJS
body: <p>Ok so I'm playing with meteorJS and I'm using a yahoo finance service to fetch some data in json format using jquery. Once I receive the data I want to store it into my mongo DB. The code I have for the purpose is as follows<br><br></p>
  
  <pre><code>Stocks = new Meteor.Collection("stocks");
  $.ajax({
    type:'GET',
    url:'http://query.yahooapis.com/v1/public/yql?q=select*from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22GOOG%22)&amp;env=store://datatables.org/alltableswithkeys&amp;format=json',
    success:function(data){
      if (Meteor.is_server) {
            Meteor.startup(function () {
              if (Stocks.find().count() === 0) {
                  Stocks.insert(data);
              }
            });
          }
      }
  });
  </code></pre>
  
  <p>now as you can see I have no clue if what I'm doing is correct or not. I know you can insert into mongo db with a json structure which is what I have but not sure if this is the right way or not.
  Any help is much appreciated.</p>