I am creating dynamic collection in my application but I am not able to fetch, insert and update that dynamic collection.
Dynamic collection created when I am inserting a Record in different collection. For example I have person collection and want to create dynamic collection of task to dynamically separate task data of every person.
Please help me out how can I implement the same in meteor?
var collectionCache = {};
function create_collection(name) {
collectionCache[name] = new Mongo.Collection(name);
Meteor.publish(collectionCache[name], function() {
return global[collectionCache[name]].find();
});
}
My collection name is task_parentID
.
Now data should saved in task_parentID
where parentID
is unique ID of that parent.