The reverse directive is just a “Reverse Index”. You don’t need to add anything. It is automatically added based on the parent.
For example. If you add a user Bob. And later you wanna add a post from Bob. You should add "uid": "uid_from_Bob, "posts": [{MY NEW POST}]. The direction is always Parent to => Child. So, the creation of the post must come with Bob’s UID and the edge posts.
To retrieve Bob when query the post you just need to use the tilde notation in the query block request.
thank you for your reply,
but it doesn’t work for me, or I don’t get it.
if I add Bob with just the uid to the post,
I can always query for post and can get bob from that post without the tilde.
I never get the post when I query for bob
I only get the post if I query for bob, if I add
the bob to the post and
this post then to bob and
store bob
all other combinations were to declare @reverse in the schema on user or on posts or on both, and with or without tilde in the type declaration seem to have no effect.
did I understand something completely wrong or where is my mistake?
sorry, I’m new to graphdb.
I don’t have to add a property(field) posts on user type.
I just declare this posts property during a query with reverse and then I have all the posts for this user
yeah makes sense. otherwise, the graph would be an endless loop.
sorry
hmm I’m confused. Looks you are questioning about HasInverse instead of Reverse. Well, what I mentioned to you should work as always did. The issue is that I don’t know the whole picture at your side to give you the precise answer, you know? But it is a fact, in the case of Reverse edges(not HasInverse) you don’t need to do anything. Just link the parent to the new child. Nothing more.
But in your case the parent could be the posts instead of the user. Or some other modeling. We never know.