Skip to content

Computed sum property doesn't work on backlinks. Is this expected? #3572

Answered by TheHyphen
TheHyphen asked this question in Q&A
Discussion options

You must be logged in to vote

oh, looks like it's an ordering bug. Just declaring the Child type before Parent type solved the issue:

module default {
    type Child {
        required link parent -> Parent;
        required property someNumber -> int64;
    }

    type Parent {
        property name -> str;
        multi link children := .<parent[is Child];
        property total := sum(.children.someNumber);
    }
}

I think this is already being tracked as mentioned here. Sorry about additional spam!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheHyphen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant