-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SortArray does not support sorting simple array types (integer/string) #4929
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
Comments
Thanks for reaching out. Care to submit a pull request? |
Tried to create PR as requested: 5258a80 |
…ray (Fixes spring-projects#4929) - Added methods `byValueAscending()` and `byValueDescending()` to the SortArray class to support sorting simple array types (e.g., integers, strings) in ascending and descending order. - Updated tests to verify the correct functionality of sorting arrays by value. - Refactored SortArray to handle sorting of simple types without requiring a property for sorting. For more details, refer to: https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/ Signed-off-by: Ranzy Blessings <ranzyblessings.inbox@gmail.com>
Hello team, I’ve addressed the issue with sorting simple arrays (integers/strings) in PR #4943 . The fix includes the addition of the byValueAscending() and byValueDescending() methods, along with updated tests to ensure correct functionality. Please don’t hesitate to reach out if any further modifications or adjustments are needed. I’m happy to make any necessary changes. Best regards, |
…h SortArray (Fixes spring-projects#4929) to cleanup excessive formatting" This reverts commit 0422055.
…ixes spring-projects#4929) spring-projects#4943 - Removed unnecessary whitespaces - Added methods byValueAscending() and byValueDescending() to the SortArray class to support sorting simple array types (e.g., integers, strings) in ascending and descending order. - Updated tests to verify the correct functionality of sorting arrays by value. - Refactored SortArray to handle sorting of simple types without requiring a property for sorting. - Removed unnecessary whitespaces and formatting changes to ensure clean, readable code. For more details, refer to: https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/ Signed-off-by: Ranzy Blessings <ranzyblessings.inbox@gmail.com>
…h SortArray (Fixes spring-projects#4929) to cleanup excessive formatting" This reverts commit 0422055. Signed-off-by: Ranzy Blessings <ranzyblessings.inbox@gmail.com>
…ixes spring-projects#4929) spring-projects#4943 - Removed unnecessary whitespaces - Added methods byValueAscending() and byValueDescending() to the SortArray class to support sorting simple array types (e.g., integers, strings) in ascending and descending order. - Updated tests to verify the correct functionality of sorting arrays by value. - Refactored SortArray to handle sorting of simple types without requiring a property for sorting. - Removed unnecessary whitespaces and formatting changes to ensure clean, readable code. For more details, refer to: https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/ Signed-off-by: Ranzy Blessings <ranzyblessings.inbox@gmail.com>
Referring to https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/
sorting of simple e.g. int array should be possible:
however
ArrayOperators.SortArray.by
only accepts typeSort
, which seems to always require a property. Not clear if any way to set a simpleASC/DESC
order to sort by.Seems simple feature that has been missed off, or if possible missed of documentation on how to achieve?
The text was updated successfully, but these errors were encountered: