SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

Problem with paging and sort_by #30

Closed tatapm closed 9 years ago

tatapm commented 9 years ago

Hi, I'm using Restheart to connect MongoDB. I have an issue with paging feature. Ex: with my filter total page: 82 and size: 8147 (collectionId is indexed) My request: Request 1: /vae_backup/collection/?sort_by=collectionId&page=8&pagesize=100&filter={"myField":"value"} Request 2: /vae_backup/collection/?sort_by=collectionId&page=82&pagesize=100&filter={"myField":"value"}

==>Range of collectionId of request 1 > request 2. Please help take time to resolve it. Thanks Mai Pham

ujibang commented 9 years ago

you mean that request 2 returns less embedded documents?

with 8147 documents, pagesize of 100 you have 82 pages with the last one containing 47 documents...

tatapm commented 9 years ago

No, example response (list collection id ) for those request request 1: {1106,1107,1108,....1205} (page 8) request 2: {500,501,502,..,599} .(page 82 - last one) But expected : {10095,10096,...,10141} (47 records) Note: the expected result returned only first time execute request.

ujibang commented 9 years ago

can you try the requests adding this query parameter: eager=none

this disables the eager dbcursor preallocation, which is the only "caching" mechanism in RESTHeart.

are you trying the requests with the embedded /browser? (just to make sure that issue is not on your client)

tatapm commented 9 years ago

I'm using Postman extension for Chrome and also with HAL browser. Finally , add parameter :eager=none work fine for me. Thanks for your support

ujibang commented 9 years ago

I'm reopening this since I want to double check this issue.

mkjsix commented 9 years ago

@ujibang should we close this issue or leave it open?

ujibang commented 9 years ago

finally found time to check this issue.

bug reproduced and confirmed, going to fix it asap

more info at https://softinstigate.atlassian.net/browse/RH-92

ujibang commented 9 years ago

fixed in development branch

will be released in version 0.11.0

thanks for reporting this