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.js...
Packages that can be used to create multi-tenant apps. https://github.com/flipace/meteor-tenantify https://github.com/mizzao/meteor-partitioner Thi...
References: https://stackoverflow.com/questions/12632452/publishing-subscribing-multiple-subsets-of-the-same-server-collection https://githu...
Meteor.methods({ test: function() { if (this.isSimulation) { return 1; // Client wants this to be 1 } else { return 2; // Server wants this to be...
if (Meteor.is_server) { Meteor.methods({ fetchFromService: function(userName) { var url = "https://api.twitter.com/1/statuses/user_timeli...