I have the same problem in DQL.
Schema:
connection: uid .
name: string .
type node {
name
connection
}
The connection predicate of a single node is updated several times to different other nodes.
When querying
{
q(func: uid(0x123)){
uid
connection {
uid
}
}
}
I get this result, where 0x1 and 0x2 where previously set connections, which should not happen. The predicate is not defined as a uid list in the schema.
"q": [
{
"uid": "0x123",
"connection": {
"uid": [
"0x1",
"0x2"
]
}
}
]
But when querying
{
q(func: uid(0x123)){
uid
connection {
uid
name
}
}
}
I get the correct result only containing the last set node.
"q": [
{
"uid": "0x123",
"connection": {
"uid": "0x2",
"name": "node2"
}
}
]
So it seems dgraph somehow does not delete the old edge when updating a connection. This also only happened when using dgraph version 24.1.0 or 24.1.1 instead of 24.0.0.