Hello @markmegerian can you guide me on this i have segment vertex and their childs have their seperate vertex because in future attributes going to be differ
/* Write query logic here */
TYPEDEF Tuple <STRING label, STRING id> feature_score;
ListAccum<feature_score> @childSegments;
start = {segment_types.*};
results = select s from start:s-(:ee)-:tt ACCUM s.@childSegments += feature_score(tt.label, tt.id);
PRINT results;
}
[
{
"results": [
{
"attributes": {
"@childSegments": [
{
"id": "High Price Sensitivity",
"label": ""
},
{
"id": "Save and Splurge",
"label": ""
},
{
"id": "Low Price Sensitivity",
"label": ""
},
{
"id": "Mid Market",
"label": ""
}
]
},
"v_id": "Price Sensitivity",
"v_type": "segment_types"
}
]
}
]
expected output, don’t want attributes object
I want directly @childSegments and the parent vertex Price Sensitivity future attributes in the same level
[
{ label: “P”,
id: “Price Se”,
children: [{ }]
},
[
{ label: “P”,
id: “Price Se”,
children: [{ }]
}
I can easily manipulate the output in backend, but want to know in GSQL as well