Comments (9)
That's an interesting issue @dmk255. I should look into it and adapt the API to this issue I think.
from decypher.
Thanks for the quick response! It'd be great if the API could support this.
from decypher.
What I propose to you is to add an argument to the forEach method taking the inner statement of the loop. Something along this:
cypher.foreach('name in {names}', 'MERGE (c {name: name})', {names: ['a']});
What do you think?
from decypher.
That definitely could work. I think having the option to put another query
object in would also be great.
E.g
subquery.merge('MERGE (c {name: name})');
cypher.foreach('name in {names}', subquery, {names: ['a']});
This would also combine the parameter objects from the subquery and the
parent query.
What do you think?
from decypher.
The only thing I need to know here, and excuse my rusty cypher, is whether the inner statement you can pass to the FOREACH
can be more complex than a single statement?
from decypher.
Yes it can. There are some limitations on what you can do in the inner
query. For example you can't use the CALL. I'm not sure of all the
limitations though.
from decypher.
Ok. Do you have other statements in mind that behave like the FOREACH
one? So I can handle them too.
from decypher.
Ther are a few that are similar but not the same. Take a look at this
document:
http://neo4j.com/docs/pdf/neo4j-cypher-refcard-stable.pdf
from decypher.
Just published v0.9.0 on npm @dmk255. Tell me whether this fits your needs and don't hesitate to come back if you find some more things needing to get tweaked.
from decypher.
Related Issues (20)
- Check that length of cartesian to 0 doesn't produce inconsistent query
- Accept tuples in arrays for query builder
- Helper to handle where clauses
- Arbitrary query to batch
- Decide what to do when adding an empty part in query builder
- Using multiple labels in helpers.nodePattern() HOT 1
- allow `decypher` requiring from a relative path to other directories than the working directory HOT 3
- Missing 'Call' as a function option HOT 3
- Reorganize code so that one may load only necessary modules
- MATCH etc. should be able to take an object as argument
- Indicate in the docs that you can have an expression fed to the query builder
- Better compartiment helpers into specific files
- Ability to remove a 'return clause' or to add above it HOT 2
- Possibility to pass no argument to query
- Build helpful #.inspect methods for classes HOT 1
- Change `predicate` to `type` in helpers.relationshipPattern
- Maybe no-op for empty array in query methods
- Should migrate to new params syntax ($ instead of {})
- Query statements should accept more types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decypher.