Hi,
RETURN apoc.coll.sort(["test1", "test10", "test2"]) AS output;
returns
["test1", "test10", "test2"]
is there a way to sort alphanumerically to get an output like
["test1", "test2", "test10"]
Hi,
RETURN apoc.coll.sort(["test1", "test10", "test2"]) AS output;
returns
["test1", "test10", "test2"]
is there a way to sort alphanumerically to get an output like
["test1", "test2", "test10"]
Not the I am aware of. As a work around, are you able to define your strings as 'test01', 'test10', and test'02' instead?
Thanks for the suggestion, 0 padding is something I'd considered but wanted to avoid if possible
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Sorting issue for alhanumeric | 1 | 435 | August 8, 2020 | |
| Cypher to remove numbers and special characters from a string in a node property and sort the alpha characters | 1 | 1405 | October 7, 2021 | |
| Order alphabetically using Cypher | 4 | 201 | March 14, 2023 | |
| Natural sort algorithm | 0 | 165 | May 17, 2022 | |
| Neo4j Sorting is not working with special character | 2 | 846 | July 28, 2021 |