1

So, I'm a complete beginner to Meteor, and basically what is want to achieve is separate mongo collections for each user that signs up.

What I've tried so far:

 MaterialData = new Mongo.Collection(Meteor.userId());

I've placed this multiple places in the js code but then I'm getting all kinds of referenceError whenever I've tried to find, update or insert data. I can't keep it global also.

What is the proper way to do this? Any better way to achieve this?

  • I think that the package actually makes a collection with all users. So, you already have an object for each of them. But if you really want to make a separate collection, my advice is to iterate through the existing collection and to create a separate one for each entry. – StefanL19 Feb 06 '16 at 09:25
  • You can get a collection by name using [dburles:mongo-collection-instances](https://github.com/dburles/mongo-collection-instances), but think hard if this is really what you want to do. Extra collections cause overhead, and I would not pursue this course of action unless there is a *really* good reason to do so. – MasterAM Feb 06 '16 at 10:09

0 Answers0