MichelDiz commented :
RFC: Improve Facets with Upsert Block
I think that the upsert would be very useful.
e.g - Here we copy rating, something, and somethingElse and add 2 new values to the facet.
upsert {
query {
me(func: eq(email, "aman@dgraph.io")) {
v as uid
edge as someEdge @facets(r as rating, t as something, e as somethingElse)
}
}
mutation {
set {
uid(v) <someEdge> uid(edge) (weight=0.1, updated_at=2019-06-02T13:01:09, val(r), val(t), val(e)) .
}
}
}
We could have a “Spread operator” (Recurse) to save time. In some cases that there are many values in facets.
e.g
upsert {
query {
me(func: eq(email, "aman@dgraph.io")) {
v as uid
edge as someEdge @facets(r as ...)
}
}
mutation {
set {
uid(v) <someEdge> uid(edge) (weight=0.1, updated_at=2019-06-02T13:01:09, val(r)) .
}
}
}
The three dots would be the operator (r as ...)
. It will copy and paste the previous values together with the new values.