Load data in batches

This forum contains topics that were moved from Get Satisfaction
Mark7294305
Posts: 0
Joined: Fri Dec 26, 2014 2:10 am

Load data in batches

Post by Mark7294305 »

Hello Support
I have a created an Appery database which contains over 500 items. I have a column called firstname. the firstname column contains the name Peter over 50 times. I want to create the ability where only 10 are displayed in the list at a time. So For example when the list is loaded the first batch of 10 is displayed onscreen and when the user clicks the next button, the second batch of 10 is displayed onscreen and when the user clicks the Prev button, the previous batch of 10 is displayed onscreen.

How can I achieve this?

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

Load data in batches

Post by Terry Gilliver »

I don't know mongodb that well, but i have done something similar MySQL using LIMIT and OFFSET.

The equivalent will be .limit() and .skip() functions..

You need to make multiple calls to the db using the limit() function and the skip() function.

limit limits the number of records per call to the db, and skip acts as an offset by skipping 'x' number of records. I can't give you any more info than that, but it should put you on the right track.

Post Reply