Hi @deanroker123
I added the count index to the schema as below.
<result>: [uid] @count @reverse .
Here is the mutation I passed into Ratel. I have enforced the nodes with context 2349732-355570
to have the same uid, so that two pink nodes (result.context) point to the same green (result) node. Hope this part makes sense.
{
"set": [
{
"uid": "_:u1",
"querystring": "(1efficiency~x)",
"result": [
{
"result.context": [
{
"context.id": "2349732-355614"
},
{
"uid": "_:sameContext",
"context.id": "2349732-355570"
},
{
"context.id": "2349732-355507"
},
{
"context.id": "2349732-355566"
},
{
"context.id": "2349732-355569"
},
{
"context.id": "2349732-355758"
}
]
}
]
},
{
"uid": "_:u2",
"querystring": "(1costs~x)",
"result": [
{
"result.context": [
{
"context.id": "2349732-355551"
},
{
"context.id": "2349732-355742"
},
{
"context.id": "2349732-355747"
},
{
"context.id": "2349732-355750"
},
{
"context.id": "2349732-355550"
},
{
"context.id": "2349732-355735"
},
{
"context.id": "2349732-355744"
},
{
"context.id": "2349732-355745"
},
{
"context.id": "2349732-355802"
},
{
"context.id": "2349732-355552"
},
{
"context.id": "2349732-355614"
},
{
"context.id": "2349732-355529"
},
{
"context.id": "2349732-355554"
},
{
"uid": "_:sameContext",
"context.id": "2349732-355570"
},
{
"context.id": "2349732-355743"
},
{
"context.id": "2349732-355771"
}
]
}
]
}
]
}
Now to the query:
{
q(func: has(context.id)) @normalize{
context.id
resultCount as count(~result.context)
}
qout(func: has(context.id)) @filter(gt(val(resultCount),1)){
context.id
}
}
The result is as below. qout
should contain the desired context id.
{
"data": {
"q": [],
"qout": [
{
"context.id": "2349732-355570"
}
]
}
}
Could you please try this and let us know?