My node structures look something like this (I’m simplifying it quite a bit):
{
uid
isTicket
tags {
uid
tag {
uid
name
}
}
I’m trying to get a returned result that looks something like this:
[
{
uid (inner most tag's uid)
name (inner most tag's name)
count (number of tickets that lead to each tag. Should be the count of the outer most uid)
}
]
So if my dataset looked something like this (I’m using a JSON’ish structure for simplicity):
[
{
uid: "0x1",
tags: [
{
uid: "0x2",
tag: {
uid: "0x3"
name: "Tag 1"
}
},
{
uid: "0x4",
tag: {
uid: "0x5"
name: "Tag 2"
}
}
]
},{
uid: "0x6",
tags: [
{
uid: "0x7",
tag: {
uid: "0x3"
name: "Tag 1"
}
}
]
}
]
The result set would look like this:
[
{
uid: "0x3",
name: "Tag 1",
count: 2
},
{
uid: "0x5",
name: "Tag 2",
count: 1
]
I’ve tried several times using the documentation to pull this off and either I get an empty result set or I crash the dgraph server. Is there anyway to do this?