Best practice form values to array for collection and using in template


#1

What is the best practice for adding multiple values to one item in a collection and then using those values within a template?

For example when adding one new ‘task’ to a collection ‘tasks’, i would have an item for ‘assigned’ within that task and store multiple user ids for those assigned to that task. Then in my template i would like to show all the tasks but filter to only those assigned to that task.

Any help much appreciated


#2

u mean find all task which have in **assigned** property (array of strings) some userid?
Tasks.find({ assigned: userId})