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

Support limit off the current query in a query tab #53

Closed
officert opened this issue Dec 24, 2015 · 3 comments
Closed

Support limit off the current query in a query tab #53

officert opened this issue Dec 24, 2015 · 3 comments

Comments

@officert
Copy link
Owner

Add support for limit right in the query editor.

Ex.

db.Users.find({
    name : 'John Doe'
}).limit(4)
@steezeburger
Copy link

Since find and the other methods are wrapping mongo calls, would we need to make these methods chainable, then add a sort(), limit(), etc? Or do you have another plan of attack? Would love to help out where I can.

@officert
Copy link
Owner Author

@steezeburger We just need to implement the parsing of the .limit() and other chainable methods in the query editor. Like you said we are just wrapping the node-mongodb methods, so it's just a matter of parsing a query to extract the limit, skip, etc...

If you look at the Collection class, where we are wrapping the methods, it's just a matter of passing down the skip and limit values as options.

The work to implement this would happen here

https://github.com/officert/mongotron/blob/master/src/lib/modules/query/parser.js

You'll see a bunch of regexes that are used to parse a query from the Codemirror editor, to extract the method name, the query, the options, etc... So we just need some regexes that can extract .limit().

@officert
Copy link
Owner Author

@steezeburger I am closing this task because we have another task for supporting any chainable methods of queries:

#28

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

No branches or pull requests

2 participants