-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with multi-level Upsert Block #4692
Comments
With this "Hack" I was able to make it work
upsert {
query {
movies(func: has(type)) @filter(has(properties)){
v as uid
Labels as labels
properties {
Title as title
Released as released
Tagline as tagline
}
}
me() {
TitleMe as sum(val(Title))
ReleasedMe as sum(val(Released))
TaglineMe as sum(val(Tagline))
}
}
mutation {
set {
uid(v) <migrationDone> "True" .
uid(v) <title> val(TitleMe) .
uid(v) <dgraph.type> val(Labels) .
uid(v) <released> val(ReleasedMe) .
uid(v) <tagline> val(TaglineMe) .
}
}
} |
Thanks for finding the bug @MichelDiz. |
Just an UpdateTesting the PR #4767 for this issue - but now creating a new node instead of update it (which is the goal of 4692, to just update instead of creating new ones). It works like that.
upsert {
query {
movies(func: has(type), first:1) @filter(has(properties) AND not has(migrationDone)){
uid
qID as id
Labels as labels
properties {
Title as title
Released as released
Tagline as tagline
}
}
me() {
LabelsMe as sum(val(Labels))
TitleMe as sum(val(Title))
ReleasedMe as sum(val(Released))
TaglineMe as sum(val(Tagline))
qIDMe as sum(val(qID))
}
}
mutation {
set {
_:New <migrationDone> "True" .
_:New <id> val(qIDMe) .
_:New <title> val(TitleMe) .
_:New <dgraph.type> val(LabelsMe) .
_:New <released> val(ReleasedMe) .
_:New <tagline> val(TaglineMe) .
}
}
} |
closing due to a bug in syncing tickets new issue #4779 |
What version of Dgraph are you using?
Latest
Have you tried reproducing the issue with the latest release?
Yes
What is the hardware spec (RAM, OS)?
N/A
Steps to reproduce the issue (command/config used to run Dgraph).
Mutation Sample
Query example
Run the Upsert Block
Expected behaviour and actual result.
This operation should be able to copy the values in the variables of the nested block, "properties". Thus allowing a kind of "migration" using Upsert Block. This feature is also equivalent to "merge". Where we collect the values of the nested block, we paste in the target node and delete the nested block right after.
The text was updated successfully, but these errors were encountered: