Performance wise I think it would also make sense to consider treating the
social networks as labels on the people.
if you put a with in between you prohibit the pattern matcher from pulling the
expression into the path evaluation.
Michael
> MATCH (me:User{id: {me} })
> MATCH me-[:FRIENDS]-(user)
> WHERE {social_network0} in user.networks
> OR {social_network1} in user.networks
> RETURN
> DISTINCT user.id as id
> ORDER BY id
> SKIP {start}
> LIMIT {limit}
Am 18.06.2014 um 23:34 schrieb Richard L. Burton III <[email protected]>:
> On the node, I have a property that's an array of social networks. I want to
> issue a query that says: Find all users whose social_networks property
> contains any of the following e.g., Twitter, Facebook, etc.
>
> Would the correct way of executing that search:
>
> MATCH (me:User{id: {me} })
> MATCH me-[:FRIENDS]-(user)
> WITH user.networks as networks
> WHERE any({social_network0} in networks)
> OR any({social_network1} in networks)
> RETURN
> DISTINCT user.id as id
> ORDER BY user.id
> SKIP {start}
> LIMIT {limit}
>
> Let {me} = numerical id
> Let {socail_network0} = twitter
> Let {socail_network1} = facebook
> Let {start} = 0
> Let {limit} = 10
>
> Cheers,
> --
> -Richard L. Burton III
> @rburton
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" 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
"Neo4j" 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.