这是indexloc提供的服务,不要输入任何密码
Skip to content

ensure correct order of sort criteria in mongodb query #172

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

Conversation

hallettj
Copy link
Collaborator

@hallettj hallettj commented Jul 8, 2025

Queries with multiple sort criteria were applying criteria alphabetically in the MongoDB query plan instead of in the order specified in the incoming NDC query.

@hallettj hallettj self-assigned this Jul 8, 2025
Comment on lines -56 to +57
.collect::<Result<BTreeMap<_, _>>>()?;
.collect::<Result<IndexMap<_, _>>>()?; // IndexMap preserves insertion order
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix - the rest of the PR is testing

@hallettj hallettj merged commit d6f85b5 into v1 Jul 8, 2025
2 checks passed
@hallettj hallettj deleted the jessehallett/eng-1810-investigate-inconsistent-sorting-behavior-in-graphql-queries branch July 8, 2025 21:12
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

Successfully merging this pull request may close these issues.

2 participants