MongoLab Query Parameters (Limit Skip)

Adding the skip and limit parameters of mongodb did not work from the MongoLab’s interface “{}, {}, 10, 20”; the equivalent of the following shell code:

db.users.find({}, {}, 10, 20); // same as above, but less clear

My final objective was to use the skip and limit parameters in the REST; luckily these parameters where actually available in REST itself :

part of MongoLab’s REST API Doc
Resource URI Referencefull docs

GET – lists databases linked to the authenticated
GET – lists sub-services for database
GET – lists collections in database
GET – lists objects in collection
POST – inserts a new object into collection
GET – returns object with _id
PUT – modifies object (or creates if new)
DELETE – deletes object with _id
GET – lists all objects matching these
optional params:
q: JSON queryreference
c: returns the result count for this query
f: set of fields to be returned in each object
(1—include; 0—exclude)
e.g. { “name” : 1, “email”: 1 } OR
e.g. { “comments” : 0 }
fo: return a single object from the result set
(same as ‘findOne()’ in the mongo shell)
s: sort order (1—asc; -1—desc)
i.e. { : }
sk: number of results to skip in the result set
l: limit for the number of results
PUT – updates one or all objects matching the query.
payload should contain modifier operations
q: JSON queryreference
m: apply update to all objects in result set
(by default, only one is updated)
u: insert if none match the query (upsert)


keywords: number of records to return, rest mongodb pymongo mongolab skip limit mongdb limit

About Neil Rubens

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *