I am creating an app for employees using Meteor and MongoDB. This app will be used by multiple organizations. So I will make a separate DB for each organization. I am facing an issue in Meteor about how to keep database name and collection name as variable. Database name will be decided on login. Then I will keep DB name in Session
.
Collection name can also be a variable.
For example:
var dbName = Session.get("dbName"); //for eg dbName="redex"
var collectionName = Session.get("collectionName"); // for ex collectionName="employees"
Employees = new Mongo.Collection(collectionName);
How to manage the variables in this case?