Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-18-2021 06:26 PM
Hi!
I'm new here and in Neo4j development. I would like to integrate neo4j with a Java server application but the thing is, considering a node (:User) I would like to define a max number of connections to it. For example, a node User can connect with 6 other nodes, no more.
I would like to know if is possible to do using cypher language or I will have to let this logic to Java.
Thanks!
10-18-2021 08:27 PM
I cannot confirm it,
But I know really well my Cypher, having taking courses and read almost if not all the Cypher manuel. I never saw such thing explicitly available in the Cypher language.
The reason why I believe it's not available at the Neo4j level it's because of the way Neo4j works behind the scene, and by scene I mean Cypher. I did some query tuning, an advanced topic of queries to learn what's behind Cypher and none of the 90 operators who runs behind Cypher would make sens if you were limiting the number of relations a node can have.
So yes I think you can already start thinking about it at the java application level if you really need to do this. I would be curious to know why you want to introduce such limitation?
Hope it helped a bit
10-18-2021 08:47 PM
Hi Claudio
Please have a look at weakly connected component algorithm(GDS) . That will tell you more about a maximum number of inbound connections a node can accept.
Thanking you
Sameer G
10-19-2021 12:31 AM
Hi @claudio.g.chepa!
Usually, this kind of logic (business) must be implemented as part the validator of your service Java Side. You can easily handle it from there as part of your Crud api.
If you really want to implement it on the DB so you have no problems with vendor lock, you cah take a look on
Bennu
All the sessions of the conference are now available online