Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
advice for paging collections
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pierre Guillaume Herveou  
View profile  
 More options Apr 25 2012, 11:09 am
From: Pierre Guillaume Herveou <pgherv...@gmail.com>
Date: Wed, 25 Apr 2012 08:09:28 -0700 (PDT)
Local: Wed, Apr 25 2012 11:09 am
Subject: advice for paging collections

Hi guys, I need your advice for different kind of pagings

I need to implement paging for something similar to a twitter list of
message in my app. I don't expect user to scroll more than 3, 4 pages in
normal usage.
What do you advice for this kind of paging. I read on the doc that skip()
could be quite slow for large collection

I have also another kind of paging where user can perform a query on a
certain type of collection (e.g collection of user filtered by user name)
and I need to page this results as well.
I don't expect queries to return more than 1000 or so document but I need
to page them 10 by 10 on the app
What would be appropriate as well for this kind of paging ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Millman  
View profile  
 More options Apr 25 2012, 11:13 am
From: Sam Millman <sam.mill...@gmail.com>
Date: Wed, 25 Apr 2012 16:13:51 +0100
Local: Wed, Apr 25 2012 11:13 am
Subject: Re: [mongodb-user] advice for paging collections

Time ranges. Twitter and fb both use time range paging for their feeds, so
you say sort by time desc and then limit by 20 and then get the ts of the
last object and use that as the skip range for the next 20. It works well.

But skip() will be no problem on 1000 documents what it means by skip being
slow is when you start paging 1000000 documents.

On 25 April 2012 16:09, Pierre Guillaume Herveou <pgherv...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pierre Guillaume Herveou  
View profile  
 More options Apr 25 2012, 2:22 pm
From: Pierre Guillaume Herveou <pgherv...@gmail.com>
Date: Wed, 25 Apr 2012 11:22:45 -0700 (PDT)
Local: Wed, Apr 25 2012 2:22 pm
Subject: Re: [mongodb-user] advice for paging collections

Thks for your help

so for the feed query you would do something like that right ?

db.feeds.find({ "time": {$lt: lastFeed.time} }).sort( { time : -1 } )
.limit(20)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Millman  
View profile  
 More options Apr 25 2012, 2:40 pm
From: Sam Millman <sam.mill...@gmail.com>
Date: Wed, 25 Apr 2012 19:40:42 +0100
Local: Wed, Apr 25 2012 2:40 pm
Subject: Re: [mongodb-user] advice for paging collections

Indeed

On 25 April 2012 19:22, Pierre Guillaume Herveou <pgherv...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »