我需要一些帮助,因为我是图形数据库的新手。
我在我的 DSE Graph 上运行这个 Gremlin 查询:
g.V('user:589435392:512').out('events').inE('events')
图表视图返回
但原始 JSON 返回:
{
"id": "{out_vertex={member_id=512, community_id=589435392, ~label=user}, local_id=d2e29e60-5fc2-11e6-87aa-8d7f17e3c204, in_vertex={member_id=0, community_id=100599424, ~label=events}, ~type=events}",
"label": "events",
"type": "edge",
"inVLabel": "events",
"outVLabel": "user",
"inV": "events:100599424:0",
"outV": "user:589435392:512"
},
{
"id": "{out_vertex={member_id=1, community_id=1205145984, ~label=user}, local_id=7c838fd0-6327-11e6-87aa-8d7f17e3c204, in_vertex={member_id=0, community_id=100599424, ~label=events}, ~type=events}",
"label": "events",
"type": "edge",
"inVLabel": "events",
"outVLabel": "user",
"inV": "events:100599424:0",
"outV": "user:1205145984:1"
}
我需要这样的东西:
{
"event": {"some infos about this event"},
"users": [{"user1"}, {"user2"},...]
}
如何实现 JSON 输出,显示用户的所有事件以及事件的所有相关用户?