I've been facing an issue with my Meteor application for quite some time now. I'm creating a platform where users can sign up for groups, upload images, and assign specific tags to their images. The Tags collection holds unique identifiers (_id) and names for each tag.
In the Group collection, each entry contains an array of _ids corresponding to available tags that users can select for their images.
Single Entry in Groups Collection
{
"_id" : "uC3PRu3qdcAF2tKK8",
"name" : "Summer Festival 2017",
"token" : "SummerFunUnited",
"tags" : [ "c6vMNnfJzFjEqDSJv", "RYNSsvmafCdRZ6Me9", "9qJD5L6PYCEcbEKcb" ]
}
The tags in the Tags collection are stored as follows:
Mongo Tags Collection
{ "_id" : "c6vMNnfJzFjEqDSJv", "name" : "Summerfanatic" }
{ "_id" : "RYNSsvmafCdRZ6Me9", "name" : "Sunshineaddict" }
{ "_id" : "9qJD5L6PYCEcbEKcb", "name" : "Danceman" }
I'm trying to create an Admin Panel where administrators can see which tags are being used in a specific group. While the route is functioning properly and I'm able to retrieve the group name in my template, I'm struggling to display the names of the tags associated with the group. My MongoDB queries are not yielding any results, and I believe I may be doing something incorrectly.
When using a query like:
Groups.find({ tags: { $in: [ "c6vMNnfJzFjEqDSJv", "RYNSsvmafCdRZ6Me9", "9qJD5L6PYCEcbEKcb" ] }})
I am not getting any results back.
I would greatly appreciate your help or suggestions on how to store tags more effectively (considering the need for administrators to add new tags in the future).
Kind Regards!