Repository navigation
Encode a ranked accumulator's sortBy as one document (2.4.x) - #4585
Open
evanchooly wants to merge 1 commit into
Open
evanchooly wants to merge 1 commit into
evanchooly wants to merge 1 commit into
Conversation
$top, $bottom, $topN and $bottomN with more than one sort key wrote sortBy as an array of one-key documents, which the server rejects; it takes one document whose keys are in priority order. Backport of #4571.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #4571 to 2.4.x, the same change as #4584.
Problem
$top,$bottom,$topNand$bottomNwith more than one sort key encodedsortByas an array of one-key documents,[{score: -1}, {player: 1}]. The server takes one document whose keys are in priority order,{score: -1, player: 1}, and rejects the array. A single sort key worked.Change
RankedResultsExpressionandNRankedResultsExpressionalways writesortByas one document. The sort orders stay Int64, as 2.4 writes them.Verification
TestRankedSortBy:topNandbottomwith two keys encode one ordered document, and the server accepts the pipeline and breaks a tie on the second key.TestTopN,TestBottomN,TestFirstNandTestLastNstill pass, 15 tests in all.