Reputation: 4216
I'm trying to use Meteor's #each
to display a JSON Object from Mongo with children. Say it looks like so:
{
data: {dorem: 'ipsum', dolor:'sit'},
amet: 'abcdefg'
}
Using #each
, I currently have something like this
<template name="base">
{{#each stuff}}
{{> info}}
{{/each}}
</template>
The info
template looks something like this
<template name="info">
{{data.dorem}}
</template>
The method I'm using to generate stuff
is
Template.base.stuff = function () {
return DBThatHasStuffInIt.find({sort:{ _id : -1 }});
};
However, it is not working. Nothing is being displayed. The base
template has been added, as well.
Does anybody know what the problem might be?
Upvotes: 0
Views: 401
Reputation: 64342
Your find, requires a selector:
return DBThatHasStuffInIt.find({}, {sort:{ _id : -1 }});
Upvotes: 1