Hi Muhammad,
Probably a mix of SELECT and MATCH will do the trick:
SELECT count(gift) as count, a, b from (
MATCH
{class:User, as:a, where:(name = 'User A')} -Shared-> {as:gift} -With->
{class:User, as:b, where:(name = 'User b')}
RETURN $patterns
) group by a, b
Just put in the WHERE condition a meaningful expression, or remove them
Thanks
Luigi
2017-02-28 11:05 GMT+01:00 Muhammad Afzal <[email protected]>:
> Hi,
> Its been only a few days since i started using a graph database (OrientDb)
> and struggling to write a very simple query for the following problem:
>
> I have two Classes named 'User' and 'Gift' connected together with two
> edges 'Shared' and 'With', structure of graph looks like the following:
> [User] ---------Shared--------> [Gift]---------With-------->[User]
> 1) I am trying to find how many times User A shared a gift with User B
> (here gift itself does not matter)
> 2) I am traversing the graph and would like to augment all the edges with
> above count
>
> Could anybody please provide me some clues on how to solve the above
> problems
> Thank you
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.