I have an FS collection. In this FS collection I have uploaded some files. I have attached these files to a list. The list has an ID and that ID is passed and saved to the metadata of FS File.
In mongoDB I see this structure.
_id
original
metadata
–> creatorId
–> createdAt
–> listId
I want to return to the uploads page only items that are relevant to the list.
So I try and return the collection using this.
Template.uploadsPage.helpers({
uploads:function(){
var currentList = this._id;
return Uploads.find({metadata: [{listId: currentList}]}, {sort: {createdAt: -1}})
}
})
Can somebody offer some guidance?