This is a Meteor/Blaze question.
I have a Mongo collection called Lists, which contains list of postIds, which I would like to query and fill in with data from another collection called Posts.
Schema
Posts: [{
_id: String,
// post data, I want to access this from a repeated list
}]
Lists: [{
_id: String,
posts: [String] // of ids
}]
List Template:
{{#if posts}} /// referring to List.posts
<div class="list-posts">
<ul>
{{#each posts}}
// here I would like query for the corresponding Posts data
{{/each}}
</ul>
</div>
{{/if}}
I'm not sure how to do this with Meteor. Template Helpers?
An elegant solution would be to use the popular
dburles:collection-helpers
package :Then you'll have to make sure the corresponding posts are published along with your lists, and you'll be able to use
{{#each posts}}
just like in your pseudo-code.