Hi, Team!
I refer to this document Upsert data to graph :: TigerGraph DB
First of all, the example of @add_id6.json is not shown in the document. I don’t know what it is.
I refer docs to construct an upsert request for RESTPP,
There is no example of updating multiple edges with the discriminator flag from one source vertex to another target vertex.
Here is my example:
CREATE DIRECTED EDGE SampleEdge(FROM SourceVertexType, TO TargetVertexType, DISCRIMINATOR(field1 STRING, field2 STRING), field3 STRING)
edge list:
SourceVertexType,TargetVertexType, field1, field2, field3
id1, id2, q1, q2, timestamp1
id1, id2, q1, q3, timestamp1
id1, id2, q1, q4, timestamp1
use DISCRIMINATOR, these are three different edges distinguished by DISCRIMINATOR() between id1 and id2. Now I need to construct a RESTPP upsert request and insert them in the same request json, but the example provided upsert request does not satisfy
This is the build request, only for this edge (it seems that there is no space to insert the remaining edges, and they will either be overwritten or ignored, because TargetVertexType uses id2 distinction)
id1, id2, q1, q2, timestamp1
{
"vertices": {
"SourceVertexType": {
"id1": {
"id": {
"value": 1
}
}
},
"TargetVertexType": {
"id2": {
"id": {
"value": 2
}
}
}
},
"edges": {
"SourceVertexType": {
"id1": {
"SampleEdge": {
"TargetVertexType": {
"id2": {
"field1": {
"value": "q1"
},
"field2": {
"value": "q2"
},
"field3": {
"value": "timestamp1"
}
}
}
}
}
}
}
}
My question is how to construct updating multiple edges with the discriminator, I can insert 3 edges at once.