Skip to content

在打印边时,起点和终点都是自动生成的id,如何同时打印自定义起点和终点号呢? #3187

Answered by BingqingLyu
zjarles asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, for the query:

g.V().has('trmnl','trmnl_black_flag',1).both('1..2', 'register')

You'll get the end vertex of the path by default. That's why you only get properties of the end vertex when you further query with valueMap().

If you want to get properties of start vertex and end vertex of the path, you can try the following query:

g.V().has('trmnl','trmnl_black_flag',1).as('start').both('1..2', 'register').dedup().endV().as('end').select('start','end').by(valueMap()).limit(10)

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@zjarles
Comment options

@sighingnow
Comment options

@BingqingLyu
Comment options

Answer selected by zjarles
Comment options

You must be logged in to vote
1 reply
@BingqingLyu
Comment options

Comment options

You must be logged in to vote
2 replies
@BingqingLyu
Comment options

@longbinlai
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants