Coder Social home page Coder Social logo

Comments (9)

Yomguithereal avatar Yomguithereal commented on August 23, 2024

That's an interesting issue @dmk255. I should look into it and adapt the API to this issue I think.

from decypher.

dan-kez avatar dan-kez commented on August 23, 2024

Thanks for the quick response! It'd be great if the API could support this.

from decypher.

Yomguithereal avatar Yomguithereal commented on August 23, 2024

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.

dan-kez avatar dan-kez commented on August 23, 2024

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.

Yomguithereal avatar Yomguithereal commented on August 23, 2024

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.

dan-kez avatar dan-kez commented on August 23, 2024

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.

Yomguithereal avatar Yomguithereal commented on August 23, 2024

Ok. Do you have other statements in mind that behave like the FOREACH one? So I can handle them too.

from decypher.

dan-kez avatar dan-kez commented on August 23, 2024

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.

Yomguithereal avatar Yomguithereal commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.