Sorry, I just re-read what you said. So assign a label to the node and then
use that in my queries. That makes more sense than using an array on a
property.

Thanks!


On Wed, Jun 18, 2014 at 6:42 PM, Michael Hunger <
[email protected]> wrote:

> No
>
> *   MATCH* (me:User{id: {*me*} })
>> *   MATCH* me-[:FRIENDS]-(user)
>> *  WHERE* user:Twitter
>>
>>          *OR*  user:Facebook
>>
>> * RETURN*
>> *DISTINCT* user.id as id
>> *   ORDER BY* id
>> *       SKIP* {*start*}
>> *      LIMIT* {*limit*}
>>
>> Am 19.06.2014 um 00:38 schrieb Richard L. Burton III <[email protected]
> >:
>
> Okay so you're saying that having a node for all the social networks and
> establishing users to that network would be faster vs. having a property on
> a user and searching whether a user has a value in it.
>
> e.g., property based
>
> MATCH (me:User{id: 1 })
> WHERE any(n in me.networks WHERE n = 'twitter') or ...
> RETURN DISTINCT me.id as id
> ORDER BY me.id
>
> vs.
>
> MATCH (me:User{id: 1 })
> WHERE (me)-[:ON]-(sn:Network{name: 'twitter'})
> RETURN DISTINCT me.id as id
> ORDER BY me.id
>
> How does that scale out with say millions of users pointing to a single
> node?
>
>
>
> On Wed, Jun 18, 2014 at 6:20 PM, Michael Hunger <
> [email protected]> wrote:
>
>> 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.
>>
>
>
>
> --
> -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.
>



-- 
-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.

Reply via email to