I am cycling through nested objects in Meteor. I need to be able to filter the nested objects, but i'm not sure how to go about doing that in meteor. Anyone have an idea how to do this?
Here is some example code:
People.attachSchema(new SimpleSchema({
name: {
type: String,
label: "Name",
max: 200
},
importantFacts: {
type: [Object],
optional: true
},
"importantFacts.$.year": {
type: Number,
index: true
},
"importantFacts.$.content": {
type: String
}
}));
Example of what I am trying to do (does not work):
<ul>
{{#each person.importantFacts.find({ year: 2010 })}}
<li>{{ content }} - {{ year }}</li>
{{/each}}
</ul>