I apologize in advance for the fact that I do not agree with my terminology and understanding with Meteor / Mongo, I just started to learn and develop with it.
I am trying to connect a local meteor application to a remote mongodb that is hosted elsewhere.
My code is as follows:
Bills = new Mongo.Collection("bills"); if (Meteor.isClient) { Meteor.subscribe("bills"); // This code only runs on the client Template.body.helpers({ documentContent: function () { return Bills.find(); } }); Template.documentBody.helpers({ documentContent: function () { var thingy = Bills.find(); console.log(thingy); return Bills.find({_id: "784576346gf874"}); } }); }
I connected to the database through the shell using the following:
$ MONGO_URL="mongodb://mysite.net:27017/legislation" meteor
In my browser, I get no errors, and within my defined template I see [Object]. The console shows a local mini-set, but does not return any of my documents from the signed collection.
I suppose I ask; if you were connecting to remote MongoDB in your local application, how would you do it?
Thank you for taking the time to read, any helpful tips are welcome.
source share