Skip to content

How to query a vertex by a property of another vertex #780

Answered by danielcweber
bCamba asked this question in Q&A
Discussion options

You must be logged in to vote

Try something like this instead:

_g.V<ShipVertex>()
    .Values(__ => __.AccountId)
    .As((__, accountId) => __
        .V<AccountVertex>()
        .Where(x => x.Id == accountId.Value))

There's no better way to express this IMO. Note, however, that this might not get optimized on your graph db system, and you could end up will a full db scan every time. You should measure response times.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bCamba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants