Meteor pagination: cursor fetch limit with getmore -


i have infinite scroll page i'm not using meteor templates draw items. reason belongs in whole other thread. i'm trying figure out how paginate data without fetching items @ once. have idea using limit on cursor, can't find real samples online of proper way this.

should server call return cursor or find limited data set? if server doesn't return cursor itself, won't lose position when try fetch next set of results?

also, want make sure retrieve data same cursor. if there 100 items , fetch 20, expect next 4 fetches 20-40, 40-60, 60-80, , 80-100. if in interim items got inserted or deleted, don't want mess fetches. handling reactivity separately , letting users decide when update items (which should reset cursor).

help/advice appreciated!

what this:

var cursor = collection.find({},{limit:100+20*page}); 

the first {} selector!

docs: http://docs.meteor.com/#/basic/mongo-collection-find

you don't have worry returning values 100-120 , 120-140 etc. since meteors ddp you!

if using meteor's blas or want have reactivity, should store page variable in session or create dependancy: https://manual.meteor.com/#deps-asimpleexample


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -