I'm new to Gremlin. Struggling to get this one right. Any help would be really appreciated.
I have the Comments(C), Plans(P) and Users(U) enter code here data in below format.
C3 - CommentsOn -> P1
C2 - CommentsOn -> P1
C1 - CommentsOn -> P1
U2 - Likes -> C3
U4 - Likes -> C3
U1 - Likes -> C1
U1 - Likes -> C2
Now I need to get the data in below format
[
{
"Comment": C3,
"LikedBy": [{U2},{U4}]
},
{
"Comment": C2,
"LikedBy": [{U1}]
},
{
"Comment": C1,
"LikedBy": [{U1}]
}
]
Meaning, I need to get the list of comments and their corresponding likes.