Kurounin / Pagination

This package allows you to paginate the subscriptions over meteor's collections. It can be used in a Blaze template or in ReactJS.
MIT License
56 stars 22 forks source link

Server side subscription max limit #66

Closed carlosalvidrez closed 6 years ago

carlosalvidrez commented 6 years ago

Hi, is there a way to set a limit as to the maximum number of documents the publishPagination server-side method could ever return? Thanks

PS. Not sure if this should be considered an "issue", apologies if not... I just have no idea how to ask a question other than through this feature.

Kurounin commented 6 years ago

Hi,

You could do that in the transform_options method

publishPagination(MyCollection, {
    transform_options: function (filters, options) {
        options.limit = Math.min(options.limit, 25);
        return options;
    }
});

But if you do this, the pager will be wrong, since it won't know that the limit was changed server side.

carlosalvidrez commented 6 years ago

Understood. That worked. Many thanks!