Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cursors to collection endpoints #37

Closed
sderickson opened this issue Jan 2, 2014 · 1 comment
Closed

Add cursors to collection endpoints #37

sderickson opened this issue Jan 2, 2014 · 1 comment

Comments

@sderickson
Copy link
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
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant