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

SortArray does not support sorting simple array types (integer/string) #4929

Open
nathanukey opened this issue Mar 18, 2025 · 1 comment
Open
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement

Comments

@nathanukey
Copy link

nathanukey commented Mar 18, 2025

Referring to https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/

sorting of simple e.g. int array should be possible:

"$sortArray":
{
    "input": [ 1, 4, 1, 6, 12, 5 ],
    "sortBy": 1
}

however ArrayOperators.SortArray.by only accepts type Sort, which seems to always require a property. Not clear if any way to set a simple ASC/DESC order to sort by.

Seems simple feature that has been missed off, or if possible missed of documentation on how to achieve?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 18, 2025
@mp911de mp911de added status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 24, 2025
@mp911de
Copy link
Member

mp911de commented Mar 24, 2025

Thanks for reaching out. Care to submit a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants