Add cursors to collection endpoints #37

Open
sderickson opened this Issue Jan 2, 2014 · 1 comment

Projects

None yet

1 participant

@sderickson
Contributor

Set up endpoints that return multiple documents to take limit values and return cursors so the client can fetch more documents as needed. These cursors could either be directly taken from MongoDB (suboptimal since that takes server resources, but built in and workable) or they could be set up as query modifications passed to the client to be passed back for more information. For example, if the collection is sorted by date, the endpoint might return a timestamp of the last item in the collection, which would be passed back and used for the same query, but only after the given timestamp. The ideal system would be something like Google App Engine's Query Cursors, but for MongoDB queries.

Endpoints that could use cursors include versions, files, and search (which would probably just require the native MongoDB cursor system). These can be found in /server/handlers/Handler.coffee.

@sderickson
Contributor

Should probably just use simple pagination for the time being. While it doesn't scale infinitely, it's much simpler than trying to come up with a universal cursor system, and is better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment