Meteor multi-tenant architecture options
Meteor.publish("data", function() {
var tenantId = Meteor.users.findOne({_id: this.userId}).tenantId;
return MyCollection.find({tenantId: tenantId}, {fields: {tenantId: 0}});
}); Meteor.publish("data", function() {
var tenantId = Meteor.users.findOne({_id: this.userId}).tenantId;
return MyCollection.find({tenantId: tenantId}, {fields: {tenantId: 0}});
}); // import data only when Products collection is empty if (Products.find().count() === 0) { console.log("Importing private/products.json to db") var data = JSON.parse(Assets.g
Packages that can be used to create multi-tenant apps. https://github.com/flipace/meteor-tenantify https://github.com/mizzao/meteor-partitioner This is a ripped down version of what's in my main.js
References: https://stackoverflow.com/questions/12632452/publishing-subscribing-multiple-subsets-of-the-same-server-collection https://github.com/meteor/meteor/issues/3259
Meteor.methods({ test: function() { if (this.isSimulation) { return 1; // Client wants this to be 1 } else { return 2; // Server wants this to be 2 } } }); Template.hello.events({ 'click butto
if (Meteor.is_server) { Meteor.methods({ fetchFromService: function(userName) { var url = "https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true