Parziphal / parse

Parse with an Eloquent-like interface for Laravel
MIT License
17 stars 13 forks source link

How does pagination work with ObjectModel? #7

Closed warrenca closed 6 years ago

warrenca commented 6 years ago

I've got thousands of data and I'm wondering how pagination works? thanks.

Parziphal commented 6 years ago

There's no a specialized method for pagination. It's hard with Parse because Parse's _id won't work for this, and using createdAt may give wrong results.

warrenca commented 6 years ago

Thanks for the reply, I actually ended up using ParseQuery, it has skip and take methods which pretty much can do the job.

Parziphal commented 6 years ago

Oh yea, I assumed you knew about them, you can use the same methods with this lib like Post::where($where)->skip($skip)->limit($limit)->get();. I thought you were asking for a speciallized pagination functionality.

Nevertheless, take into account that Parse has a limit on skip; you can't skip beyond 10k documents. There's a little more info here: https://github.com/parse-community/Parse-SDK-JS/issues/298