Dynamic Variable Names
See original GitHub issueThank 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)
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Use dynamic variable names in JavaScript - Stack Overflow
var id = "abc"; var mine = {}; mine[id] = 123; console.log(mine.abc);. gives 123. Usually you want to construct the variable which is...
Read more >Dynamic variable names - Rosetta Code
In Déjà Vu, variable names are idents, which are completely separate from strings, and cannot easily be created from them. · In E,...
Read more >How to Use Dynamic Variable Names in JavaScript? - Linux Hint
The dynamic variable names mean that the names of variables are modified randomly or are user-defined. The eval() method is specifically utilized to ......
Read more >How to make dynamic variable names (A1, A2 ... - MathWorks
I did find dynamically named variables useful for a specific need. I have several files in a directory. Each file has a few...
Read more >Create and use dynamic variable names in JavaScript
Dynamic variables are those types of variables that don't have any specific name in the code through hard coded. A dynamic variable name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to get
STATEMENT
to print out, I think that is an error with theAnon
object. I will check into it.I did manage to get something going based on what you want using the
ConditionalAND
(https://github.com/emehrkay/Pypher#conditionals) objectpy2neo is great. Here is the base query method that accepts params https://py2neo.org/2021.1/workflow.html#py2neo.Graph.run