Error: Must use an ordered observe with skip or limit
Opened this issue · 1 comments
Getting this error when passing a function that returns a collection.find(..., { limit: X }) cursor to {{> reactiveTable collection=posts}}
:
Exception in template helper: Error: Must use an ordered observe with skip or limit (i.e. 'addedBefore' for observeChanges or 'addedAt' for observe, instead of 'added').
Template.content.helpers({
posts: function () {
return Posts.find({}, {
limit: 100,
})
}
});
Interesting... reactive-table sets its own skip and limit based on rows per page, and in order to do that it converts the cursor to a collection by listening for changes, which I guess doesn't work when your cursor has a skip or limit already. I don't know how complicated it would be to switch to ordered observe like the error suggests.
If you only want 100 rows you might be fine using find().fetch()
and passing in an array instead.