I am trying to sub to a collection called items
, but every time I try to sub with a limit or skip, it returns the whole collection because it thinks the params are undefined. For example, I am trying to render 1 item from the collection:
Meteor.subscribe("items", 1, 0);// 1 item, 0 skip
Tracker.autorun(() => {
console.log(items.find({}).fetch());
})
When I do this, the entire collection gets printed. In the server, when I print the params of the publication:
Meteor.publish("items", (l, s) => {
console.log(l, s);
// returns: undefined undefined
// 1 0
return items.find({}, {limit: l, skip: s});
})
And on the client side, I get all the documents rendered instead of just the one. Is there something I'm missing here or doing wrong???