Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-06-2019 03:30 AM
12-06-2019 09:14 AM
Your create
command needs to be inside quotations
12-06-2019 02:59 PM
Also your inner query needs to RETURN something otherwise the call won't YIELD a row
12-07-2019 09:39 AM
can you give example for the same
12-07-2019 06:31 PM
MATCH (n:user{USR_ID:'15200'})--(r)--(m:user)
WITH n,r,m
CALL apoc.do.when(exists(r.mobile),
"create(a:ids{id:userId})-[:linked]-(m) RETURN a" ,"create(a:ids{id:userId})-[:not_linked]-(m) RETURN a", {m:m, userId:n.USR_ID}) YIELD value
RETURN 1
I realized those creates must have been intended to be the if and else part, not both in the if, so I separated them. Also as you're looking to create a new :ids node for a
in both cases from n's USR_ID, I made sure we're passing in the variables to the call that need to be used in those queries.
12-07-2019 09:12 PM
thanks it worked for ..
but i need little help...
can you share me some source from where i can understand the background working of cypher queries
it would be great help for me to understand neo4j more efficiently
12-07-2019 11:02 PM
Hi, Yeshveer
What was really worked wel for me - simple official manuals!
https://neo4j.com/docs/cypher-manual/current/syntax/
Also I advice you to learn and be aware of handy APOC functionality. 99% of Cypher queries uses APOC:
https://neo4j.com/docs/labs/apoc/current/
Bonus: Having a chance to advertise something, may I advertise you my blog-post of Cypher Tutorial. It have Cypher Quiz so you can try your skills after learning some Cypher basics:
12-08-2019 12:40 AM
in this case multiple ids are being made with same value..
but i need only two ids node
one have all linked node connected and other have all not_linked note connected ..
i tried merge also but not getting what i want ..
12-08-2019 04:26 AM
Your query has the :ids node created with a specific id, the the id the :user from your first match. If you only need two :ids nodes, then you can't use a property that depends on the user's id (unless there are only two :user nodes, thus only two ids to use).
You may need to explain more about what you're really trying to do here, I don't think we have a clear context.
12-08-2019 09:59 PM
here situation is ...
suppose a user is coonected to a mobile node with relation [HAVE_MOBILE] and similarly to other nodes
and other user is also connected to these node mobile and other with same relation .
now i want user which are connect through mobile node to each other should form one group which i named as ids and remaining connect to other group .
12-09-2019 01:16 PM
That makes sense when there's one obvious central node. But what about patterns where there isn't one obvious central node? Let's say you had multiple graphs like these that were connected to each other such that there wasn't some obvious central node. Which user node would you use in this case?
Also, from the point of view of n
and m
, it looks like you would create an ids node for each (if you weren't specifying the USR_ID for n
). What means do you want to use to choose between the connected nodes, which one should be used for the id?
12-09-2019 08:38 PM
ok let the id of central node be any thing. id does not matter i need to make these groups
let id be some random number or 1
here central node is not the concern. we can change that, but grouping is important
All the sessions of the conference are now available online