rogue pagination

24 views
Skip to first unread message

Andrea Zaza

unread,
Jul 25, 2014, 1:11:40 PM7/25/14
to rogue...@googlegroups.com
Hi all,

I have a problem with pagination, rogue 2.2.0.
The following query is working fine locally: I query for different pages and I can get the correct result.  

event.where(_.date_time after now_).and(_.geolatlng  near(39, 9, Degrees((50 / 6378.137).toDegrees))).paginate(25).setPage(p).fetch

The same query in production (sever) is getting 0 results for p parameter grater than 1. 
The only difference between development and production is the mongodb version. Any help?


Thanks,


Andrea
 



Jason Liszka

unread,
Jul 25, 2014, 1:31:23 PM7/25/14
to rogue...@googlegroups.com
What mongo versions are you running? I see various reports on the web about $near not playing well with $skip.

25 is a very small page size, you probably won't hurt the server by asking for more than that. Maybe you could ask for all results and paginate in the client?


--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrea Zanda

unread,
Jul 26, 2014, 11:28:03 AM7/26/14
to rogue...@googlegroups.com
On Fri, Jul 25, 2014 at 7:31 PM, Jason Liszka <jli...@foursquare.com> wrote:
What mongo versions are you running? I see various reports on the web about $near not playing well with $skip.

production (the one not working): 2.6.0
dev: 2.4.6 

25 is a very small page size, you probably won't hurt the server by asking for more than that. Maybe you could ask for all results and paginate in the client
 
I think it is too much work, the client is mobile. I prefer keep it light.
So the solutions can be:
1) implement my own pagination server side
2) Downgrade mongodb version server side
3) upgrade rogue version? Maybe to 3.0.0

Do you agree?

Thanks for your help!

Andrea


 


On Fri, Jul 25, 2014 at 1:11 PM, Andrea Zaza <zanda...@gmail.com> wrote:
Hi all,

I have a problem with pagination, rogue 2.2.0.
The following query is working fine locally: I query for different pages and I can get the correct result.  

event.where(_.date_time after now_).and(_.geolatlng  near(39, 9, Degrees((50 / 6378.137).toDegrees))).paginate(25).setPage(p).fetch

The same query in production (sever) is getting 0 results for p parameter grater than 1. 
The only difference between development and production is the mongodb version. Any help?


Thanks,


Andrea
 



--
You received this message because you are subscribed to the Google Groups "rogue-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rogue-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "rogue-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rogue-users/IFOW2EHfvBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rogue-users...@googlegroups.com.

Jason Liszka

unread,
Jul 26, 2014, 11:41:14 AM7/26/14
to rogue...@googlegroups.com
The first thing I would try is (2) making your production mongo version match your development mongo version. It's a good idea anyway to have your development and production environments match as closely as possible.

Upgrading rogue (3) is unlikely to help as rogue just passes the skip and limit parameters to mongo. Implementing your own pagination (1) will work as long as you aren't relying on skip.

Andrea Zanda

unread,
Jul 26, 2014, 1:39:34 PM7/26/14
to rogue...@googlegroups.com
Great! I opted for (2)

Thanks,

Andrea
Reply all
Reply to author
Forward
0 new messages