Search code examples
mongodbeve

Disable Paging on eve mongodb at API level


So I have an API something like this
http:exmaple.com/people
When I use this to retrive data , the response is limited to 25 entries per page. I want to receive all the data all at once i.e bypassing the pagination. I do not have access to the server. How to do this. I tried putting ?page=all and lot more stuff.But nothing seems to work. I have tried max, skip but those also have no effect.


Solution

  • There are a number of (server) settings that allows an API maintainer to turn pagination features on and off. Quoting from the docs:

    PAGINATION. True if pagination is enabled for GET requests, otherwise False. Can be overridden by resource settings. Defaults to True.
    
    PAGINATION_LIMIT. Maximum value allowed for QUERY_MAX_RESULTS query parameter. Values exceeding the limit will be silently replaced with this value. You want to aim for a reasonable compromise between performance and transfer size. Defaults to 50.
    
    PAGINATION_DEFAULT. Default value for QUERY_MAX_RESULTS. Defaults to 25.
    
    OPTIMIZE_PAGINATION_FOR_SPEED. Set this to True to improve pagination performance. When optimization is active no count operation, which can be slow on large collections, is performed on the database. This does have a few consequences. Firstly, no document count is returned. Secondly, HATEOAS is less accurate: no last page link is available, and next page link is always included, even on last page. On big collections, switching this feature on can greatly improve performance. Defaults to False (slower performance; document count included; accurate HATEOAS).
    
    

    If you don't have access to the server, there is no way you disable pagination, either globally or at endpoint level.