title: Meteor database connection
body: <p>I am trying to connect to my Mongo database which is situated on the machine as my Meteor app. Here are two files in my app:</p>
  
  <p>a.js:</p>
  
  <pre><code>if (Meteor.isServer) {
  
      var database = new MongoInternals.RemoteCollectionDriver("mongodb://127.0.0.1:3001/meteor");
      Boxes = new Mongo.Collection("boxes", { _driver: database });
      Meteor.publish('boxes', function() {
          return Boxes.find(); 
      }); 
  }
  </code></pre>
  
  <p>b.js:</p>
  
  <pre><code>if (Meteor.isClient) {
      Meteor.subscribe('boxes');
      Template.homeCanvasTpl.helpers({
          boxes: function () {
              return Boxes.find({});
          }
      });
  }
  </code></pre>
  
  <p>But I keep getting a "Exception in template helper: ReferenceError: Boxes is not defined" error - any ideas?</p>