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

Option for arrayLimit returning data even if it's over the limit #5357

Open
thelinuxlich opened this issue Feb 4, 2016 · 4 comments
Open

Comments

@thelinuxlich
Copy link

It would be nice if we had a .run() optarg to let the query return as much documents as possible instead of throwing an error because of arrayLimit.

I mean, if arrayLimit is 100k and the query results in 500k rows, return 100k

@danielmewes danielmewes added this to the backlog milestone Feb 4, 2016
@danielmewes
Copy link
Member

I suspect that you can emulate this in most (if not all) cases by inserting .limit(100000) terms into your query at the right places (before the command that converts the data into an array). Though I can see that becoming a bit annoying if you're building ad-hoc queries from user requests.

One issue with truncating automatically is that things might no longer behave in the expected way.
For example if you have a non-indexed orderBy("val"), and we simply truncate the input to 100k elements, then the first result in the output is not actually going to be the one with the smallest val.

@thelinuxlich
Copy link
Author

Isn't this a temporary limitation because there are features that should be streamable and currently aren't?

@danielmewes
Copy link
Member

@thelinuxlich That is true for some terms, but not for others. An un-indexes orderBy can never be streaming for example as far as I can tell. It needs to wait for all inputs before it can determine which input is the smallest.
Would it help us here if it was temporary?

@thelinuxlich
Copy link
Author

You're right, but then .limit() before orderBy() would have the same effect, with the disadvantage of routing everything to one shard

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