Meteor: one database for each tenant in an application with multiple tenants

Most older blogs / posts suggest using tenant_id in every entry in the collection. And use tenant_id in each request to isolate tenants in the Meteor app.

But is it now possible to have one MongoDB database for each tenant in an application with several tenants and make a Meteor transition between these databases depending on tenant_id / subdomain? Or is adding the tenant_id to each record the only way to implement a multi-tenancy in Meteor?

+4
source share
1 answer

It is possible, but not documented - use at your own risk:

var d = new MongoInternals.RemoteCollectionDriver("<mongo url>");
C = new Mongo.Collection("<collection name>", { _driver: d });
0

All Articles