Ordering descendents
See original GitHub issueHi,
I can’t figure out how to order the descendents when executing findAll({ hierarchy: true })
I’m looking to order the data by a specific property as well. For example I’d like my hierarchy of folders to be returned in order of there name:
{
name: "rootFolder"
children: [
{ name: "A Folder"},
{ name: "B Folder"},
{ name: "C Folder"},
]
}
Is this possible?
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Descendants Movies in Order: How Many Are There?
Descendants movies in order (by release date). 1. Descendants (2015). Director: Kenny Ortega. Writer: Josann McGibbon ...
Read more >Descendents • Official Store - Feature.fm
You're all set! Descendents • Official Store. Shop Official Music & Merch. officialstore. Purchase. By using this service you agree to our Privacy...
Read more >DNA Testing for Ancestry & Genealogy | FamilyTreeDNA
... and unlock the secrets of your ancestry and genealogy with our DNA kits for ancestry and the ... Sign in to your...
Read more >Buy Descendents Merch | Official Shop | Kings Road Merch
Browse Official Descendents Online Shop and find bestselling & exclusive merch. Wide range of awesome clothing, LPs, CDs and more!
Read more >Descendants of Order 66 - A Star Wars Fanfilm - YouTube
In May 2006, 3 fans left for Tunesia to shoot their own STAR WARS Movie. Seven days later they came back with dirty...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@leroydev I’ve replicated this issue and found a fix. Just got to write some tests and I’ll push to npm.
In the meantime, the fix is here if you need it urgently: https://github.com/overlookmotel/sequelize-hierarchy/commit/e733da1c4d4ed23011cac740a7ba1e5c17e1115c
Fixed in v0.7.2, just published on npm.
This was a pretty bad bug - ordering is a common requirement. Thanks loads for finding it and bringing it to my attention.