Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in generated query with edge pointing back to same Node #589

Closed
na-ka-na opened this issue Nov 23, 2021 · 0 comments
Closed

Bug in generated query with edge pointing back to same Node #589

na-ka-na opened this issue Nov 23, 2021 · 0 comments

Comments

@na-ka-na
Copy link

Example Node

class Extension(StructuredNode):
    extension = RelationshipTo('Extension', 'extension', cardinality=ZeroOrMore)

Now the query is:

n = ... # node of type Extension
for ne in n.extension.all():
   pass 

The n.extension.all() produces invalid query string as follows:

MATCH (extension) WHERE id(extension)=12796 WITH extension MATCH ((extension)-[r1:extension]->(extension:Extension)) RETURN extension

The correct query should be something like the below (see the different match variable extension1)

MATCH (extension) WHERE id(extension)=12796 WITH extension MATCH ((extension)-[r1:extension]->(extension1:Extension)) RETURN extension1

This took me quite a while to figure out since it was buried under layers of logic and also because of this #588

@AntonLydike AntonLydike added this to To do in Neomodel Maintenance via automation Sep 16, 2022
mariusconjeaud added a commit that referenced this issue Sep 26, 2023
Fix #589 match relationship with same name as source and target nodes
Neomodel Maintenance automation moved this from To do to Done Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants