Hello to everyone, I'm very newbie in neo4j graph DB.
I can get shortest paths between a source user and 100 other target users as follows:
MATCH p = shortestPath(
(u1:User)-[:follows*]->(u2:User {userID:"17911468618"})
)
WHERE u1.userID IN ["173560420","232192182","427553890","6860189","26669533","2094200507","6590609","290023231","260375673","19410587","29394004","14455831","1287006597","186904952","303054725","212742998","44059601","1574083","979177642","1550693326","3132929984","1918078581","284920884","907025384","4213518589","1518284433","1822594644","1506607755","637874562","10482862","176702683","188222091","29421778","1521885756","246194371","2482066817","176618189","187619120","40992858","524226044","371299822","55795588","2274763833","1470414259","2033147472","421468021","1547627005","2289707047","22079794","18900337","144605776","1234301500","1942463581","496865116","1506896522","266928623","414113135","10206720","1363484236","232024162","350708102","324599988","23577429","197260775","50417061","1371714791","263110431","5486909","192417402","248633614","185546187","26444210","266319242","189396108","550150293","24065795","1036534773","489110643","6311667","1660662141","1962023419","271229086","1412007771","548017775","566276178","46983271","1635861286","21193118","9232256","378496191","314761038","1777543238","191110424","277509338","16264572","175353759","270902355","21629668","325848806","242066770"]
RETURN nodes(p) as results
in this query WHERE u1.userID IN statement has 100 different unique IDs.
The returning results of this query:
That's okey, it means; 89 out of 100 target users in the list has a :follows path to the source user.
However I want to break the loop when the first 3 target users found which has a path to the source user , is it possible to do that? Thank you.