export MONGO_URL=mongodb://username:password@localhost:27017/dbname
Result is following.var Test = new Mongo.Collection('test'); if (Meteor.isClient) { // counter starts at 0 Session.setDefault('counter', 0); Template.hello.helpers({ counter: function () { return Session.get('counter'); } }); Template.hello.events({ 'click button': function () { // increment the counter when button is clicked Session.set('counter', Session.get('counter') + 1); console.log(Test.findOne()); } }); } if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup Test.insert({name:"A", age:25}); Test.insert({name:"B", age:31}); Test.insert({name:"C", age:22}); console.log(Test.findOne()); }); }
meteor remove autopublish
You can restrict published data amount.var Test = new Mongo.Collection('test'); if (Meteor.isClient) { Meteor.subscribe('testdata'); // counter starts at 0 Session.setDefault('counter', 0); Template.hello.helpers({ counter: function () { return Session.get('counter'); } }); Template.hello.events({ 'click button': function () { // increment the counter when button is clicked Session.set('counter', Session.get('counter') + 1); console.log(Test.findOne()); } }); } if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup Test.insert({name:"A", age:25}); Test.insert({name:"B", age:31}); Test.insert({name:"C", age:22}); console.log(Test.findOne()); Meteor.publish('testdata', function() { return Test.find({name:"B"}); }); }); }
Streamlit is a …