Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

createRelationship metod #9

Closed
jadranpro opened this Issue · 1 comment

2 participants

@jadranpro

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
Owner

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
@wfreeman wfreeman referenced this issue from a commit in wfreeman/node-neo4j
@wfreeman wfreeman Fixing cypher tests #9 dfa9a5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.