-
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 |
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, |
…ay () - 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/ Resolves: #4929 Original Pull Request: #4943 Signed-off-by: Ranzy Blessings <[email protected]>
Add method to provide sorting direction to sort array aggregation. Related to: #4929 Original Pull Request: #4935 Signed-off-by: Nathan McDonald <[email protected]>
Add method to provide sorting direction to sort array aggregation. Related to: #4929 Original Pull Request: #4935 Signed-off-by: Nathan McDonald <[email protected]>
…ay () - 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/ Resolves: #4929 Original Pull Request: #4943 Signed-off-by: Ranzy Blessings <[email protected]>
Add method to provide sorting direction to sort array aggregation. Related to: #4929 Original Pull Request: #4935 Signed-off-by: Nathan McDonald <[email protected]>
…ay () - 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/ Resolves: #4929 Original Pull Request: #4943 Signed-off-by: Ranzy Blessings <[email protected]>
Add method to provide sorting direction to sort array aggregation. Related to: #4929 Original Pull Request: #4935 Signed-off-by: Nathan McDonald <[email protected]>
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: