Skip to content

Dynamic Variable Names #46

@hrishikeshrt

Description

@hrishikeshrt

Thank you for this package.
I wanted to know if the nodes can be specified by strings

For example, I want to write a query

MATCH (n) WHERE n.root = "Something"

Now, I can do this using
p.Match.node('n').Where.n.property('root') == "Something"
However, I have to do this for many variables for a longer pattern in MATCH, and the name n is generated dynamically,
for example it could be n1, n2, n3 etc depending on which iteration of loop it is in. Is it possible to achieve that?

I tried giving Where.raw('n') and Where._('n') but both insert a STATEMENT word in the query.

(Apologies if this is a stupid question)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions