javascript - Is it possible to limit "each in" in Meteor? -
i'm writing rss reader using meteor. server parses .rss/.xml , splits in several items written collection.
on client-side feed items displayed. how can limit number of items displayed on page ? tried limit in return statement that's not working.
{{#each item in feed_item}} <div class="row"> <div class="col-lg-12"> <h3><a href="{{item.link}}" target="_blank">{{item.title}}</a></h3> <h4>{{item.pubdate}}</h4> <h5>{{item.website}}</h5> <p>{{item.description}}</p> </div> </div> {{/each}} db_feed_item = new meteor.collection("feed_item"); template.feed.helpers({ 'feed_item': function () { return db_feed_item.find({} , {sort: {pubdate: -1}}, {limit: 10}); } });
any appreciated.
there should 1 object options. replace
{sort: {pubdate: -1}}, {limit: 10}
with
{sort: {pubdate: -1}, limit: 10}
Comments
Post a Comment