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

createRelationship metod #9

Closed
jadranpro opened this issue Oct 15, 2011 · 1 comment
Closed

createRelationship metod #9

jadranpro opened this issue Oct 15, 2011 · 1 comment

Comments

@jadranpro
Copy link

Hi, I like node-neo4j very much.

I need to implement someting like this
" ... relation = db.createRelationship(currentNodeId, id, "VSEBUJE", saveRelation) ..."

but in source code is stated:

"...
# Relationships
createRelationship: (startNode, endNode, type, _) ->
# TODO: Implement
..."

Can you give me some advise how can I implement this metod.

Thank you , Jadran

@aseemk
Copy link
Member

aseemk commented Jan 25, 2012

Sorry for the delay in responding -- we totally missed this.

The library follows the REST API's conventions. The REST API doesn't have a way to create a relationship arbitrarily, but rather to create a relationship from/to a node. So the library exposes this via Node instance methods createRelationshipTo() and createRelationshipFrom().

rel = node1.createRelationshipTo(node2, 'FOLLOWS', {
    created: Date.now()
}, callback);

Hope this helps!

@aseemk aseemk closed this as completed Jan 25, 2012
freeeve added a commit to freeeve/node-neo4j that referenced this issue Oct 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants