Implement maximum_results
option
#1215
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working on large mono-repos some queries might take a very long time due to listing all files on the project.
This waiting time is a combination of building the results array and serialising it back.
This commit adds a query option
maximum_results
, which allows clients to ask the server to truncate results above a certain threshold number.On that case, a flag is sent back indicating to the client results have been truncated.
We could change this diff to read this value as a global setting rather than a per request setting. But then for any given instance we'd need to globally assume the setting is handled correctly, which may not be the case.
I still need to test direct BSER clients against this change.
I'd appreciate an opinion on the diff & where to write automated tests for this. I don't see unit-testing around this area, so I imagine those would be integration tests.