github.com/icza/minquery (go): Package minquery provides a mgo-like Query type called MinQuery, which supports efficient query pagination (cursors to continue listing documents where we left off).  Let's say we have a users collection in MongoDB modeled with this Go struct:  To query users having country=USA, sorted by Name and ID:  And that's all. newCursor is the cursor to be used to fetch the next batch.  Note #1: When calling MinQuery.All(), you have to provide the names of the cursor fields, this will be used to build the cursor data (and ultimately the cursor string) from.  Note #2: If you're retrieving partial results (by using MinQuery.Select()), you have to include all the fields that are part of the cursor (the index entry) even if you don't intend to use them directly, else MinQuery.All() will not have all the values of the cursor fields, and so it will not be able to create the proper cursor value.
Keywords: cursor|mgo|mongodb|pagination|query