Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Must use an ordered observe with skip or limit #486

Open
dandv opened this issue Feb 24, 2018 · 1 comment
Open

Error: Must use an ordered observe with skip or limit #486

dandv opened this issue Feb 24, 2018 · 1 comment

Comments

@dandv
Copy link
Contributor

dandv commented Feb 24, 2018

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,
    })
  }
});
@aslagle
Copy link
Owner

aslagle commented Feb 26, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants