Open arenddeboer opened 8 years ago
You can set the option object on treeize instance with prune:true
, that should fiex the null problem
Unfortunately the prune option has no effect. (Prune seems to be on by default)
for the moment I try setting as much columns to a default value of "" But this is poor database design and will not work with foreign key references. I wonder why this is not a huge issue for working with this library as it specifically mentions sql joins as a use case where NULL columns are more rule than the exception.
For anyone running into this, the treeize inspired flatToTrees seems handle null values better.
I had the same problem with the null column value (for a deleted date which is null 99% of the time). It is fixable with the workaround to suffix the column name with '*', it is documented here https://github.com/kwhitley/treeize#specifying-your-own-keyblueprint-for-collections
I got it working with the same approach @pom421 used.
When rows contain a field with a null value, they are treated as different values and even though the rows should be merged, they are not.
Or am I missing something ?